Skip to content

Instantly share code, notes, and snippets.

@glitsj16
Created July 30, 2017 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glitsj16/43a0572dbb613be9d5c42a02b3992911 to your computer and use it in GitHub Desktop.
Save glitsj16/43a0572dbb613be9d5c42a02b3992911 to your computer and use it in GitHub Desktop.
/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-umount
= = = = = = = = = = = = = = = = = = = = =
[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