diff --git a/.etckeeper b/.etckeeper index 577e067a..f4f70403 100755 --- a/.etckeeper +++ b/.etckeeper @@ -2190,6 +2190,7 @@ maybe chmod 0755 'systemd/system/sysinit.target.wants' maybe chmod 0755 'systemd/system/systemd-udevd.service.d' maybe chmod 0644 'systemd/system/systemd-udevd.service.d/override.conf' maybe chmod 0755 'systemd/system/timers.target.wants' +maybe chmod 0644 'systemd/system/usb-mount@.service' maybe chmod 0644 'systemd/timesyncd.conf' maybe chmod 0755 'systemd/user' maybe chmod 0644 'systemd/user.conf' @@ -2207,6 +2208,7 @@ maybe chmod 0755 'udev' maybe chmod 0755 'udev/hwdb.d' maybe chmod 0755 'udev/rules.d' maybe chmod 0644 'udev/rules.d/99-com.rules' +maybe chmod 0644 'udev/rules.d/99-local.rules' maybe chmod 0644 'udev/udev.conf' maybe chmod 0755 'ufw' maybe chmod 0755 'ufw/applications.d' diff --git a/systemd/system/usb-mount@.service b/systemd/system/usb-mount@.service new file mode 100644 index 00000000..dcc838cf --- /dev/null +++ b/systemd/system/usb-mount@.service @@ -0,0 +1,7 @@ +[Unit] +Description=Mount USB Drive on %i +[Service] +Type=oneshot +RemainAfterExit=true +ExecStart=/usr/local/bin/usb-mount.sh add %i +ExecStop=/usr/local/bin/usb-mount.sh remove %i diff --git a/udev/rules.d/99-local.rules b/udev/rules.d/99-local.rules new file mode 100644 index 00000000..f942118d --- /dev/null +++ b/udev/rules.d/99-local.rules @@ -0,0 +1,3 @@ +KERNEL=="sd[a-z]*[0-9]", SUBSYSTEMS=="usb", ACTION=="add", RUN+="/bin/systemctl start usb-mount@%k.service" + +KERNEL=="sd[a-z]*[0-9]", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/bin/systemctl stop usb-mount@%k.service"