Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
/etc/udev/rules.d/60-ios.rules
= = = = = = = = = = = = = = = = = = =
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="05ac", RUN+="/etc/mikkel/ios mount"
ACTION=="remove", SUBSYSTEM=="usb", ATTRS{idVendor}=="05ac", RUN+="/etc/mikkel/ios unmount"
/etc/mikkel/ios
= = = = = = = = = =
#!/bin/sh
#
## called from /etc/udev/rules.d/60-ios.rules
systemctl start ios-${1}.service > /dev/null 2>&1
exit 0
/etc/systemd/system/ios-mount
= = = = = = = = = = = = = = = = = = = = =
[Unit]
Description=Mount IOS
RequiresMountsFor=/home/
[Service]
User=mikkel
Type=oneshot
ExecStart=/home/mikkel/usr/bin/ios_script mount
/etc/systemd/system/ios-unmount
= = = = = = = = = = = = = = = = = = = = =
[Unit]
Description=Unmount IOS
RequiresMountsFor=/home/
[Service]
User=mikkel
Type=oneshot
ExecStart=/home/mikkel/usr/bin/ios_script unmount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment