I have a USB device that will create a hidraw file in /dev when it is attached. after you unplug the device the file is deleted How can I write a script that I can run after plugging in the device. The hidraw file needs the permissions changed for some reason? I've been doing the below on the command program but I would like to be able to just run a script to do this.
Thanks
cd ../..
cd dev
sudo chmod 777 hidraw*
SOLVED: How can I write a script to do the following ...
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
SOLVED: How can I write a script to do the following ...
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: How can I write a script to do the following ...
You shouldn't write a script as such but a udev rule. Which, mind you, only come across as intimidating. Usually and in this case someone else has already done the work and you only need to place a single-line file somewhere under /etc/udev/rules.d. See first (self-)answer at https://unix.stackexchange.com/question ... ermissions
Re: How can I write a script to do the following ...
Thank you kind sir Worked like a charm.
I added KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev" to a file and that's IT
I added KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev" to a file and that's IT