summaryrefslogtreecommitdiff
path: root/triggersad/files/triggerhappy.hotplug
diff options
context:
space:
mode:
Diffstat (limited to 'triggersad/files/triggerhappy.hotplug')
-rw-r--r--triggersad/files/triggerhappy.hotplug15
1 files changed, 15 insertions, 0 deletions
diff --git a/triggersad/files/triggerhappy.hotplug b/triggersad/files/triggerhappy.hotplug
new file mode 100644
index 0000000..78ad349
--- /dev/null
+++ b/triggersad/files/triggerhappy.hotplug
@@ -0,0 +1,15 @@
+#!/bin/sh
+THD_SOCKET=/tmp/triggerhappy.socket
+[ -S "$THD_SOCKET" ] || exit
+
+case "$ACTION" in
+ add)
+ DEVICE="/dev/$DEVNAME"
+ [ -c "$DEVICE" ] || exit
+ # offer device to triggerhappy daemon
+ /usr/sbin/th-cmd --socket "$THD_SOCKET" --add "$DEVICE"
+ ;;
+ remove)
+ # nothing to do
+ ;;
+esac