Created
September 11, 2018 16:04
-
-
Save Und3rf10w/90b1b6103e2c7bdb95197ecb0ea6aa2c to your computer and use it in GitHub Desktop.
Udev Setup script to notify any changes to USB subsystem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Udev rule in /etc/udev/rules.d/ | |
| ACTION=="add", RUN+="/usr/local/bin/udevnotify" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # In `crontab -e` use this entry, replacing $USER with your username: | |
| * * * * * /home/$USER/.local/udevnotifycheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Store me in /usr/local/bin | |
| # Replace $USER with the user account you want to use | |
| touch /dev/shm/usbmodified | |
| chown $USER:$USER /dev/shm/usbmodified |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Store me in ~/.local/udevnotifycheck | |
| #!/bin/bash | |
| if [ -f /dev/shm/usbmodified ]; then | |
| # Put your pushover/notify command here | |
| rm /dev/shm/usbmodified | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment