]> git.zerfleddert.de Git - hmcfgusb/commitdiff
OpenWRT hotplug-script (starts hmland when device is plugged in)
authorMichael Gernoth <michael@gernoth.net>
Sat, 1 Jun 2013 10:01:00 +0000 (12:01 +0200)
committerMichael Gernoth <michael@gernoth.net>
Sat, 1 Jun 2013 10:01:00 +0000 (12:01 +0200)
20-hmlan.OpenWRT [new file with mode: 0644]
Makefile.OpenWRT

diff --git a/20-hmlan.OpenWRT b/20-hmlan.OpenWRT
new file mode 100644 (file)
index 0000000..620244f
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+if [ "${PRODUCT:0:9}" = "1b1f/c00f" ]; then
+       logger "HMLAN: ${ACTION} ${PRODUCT}"
+
+       case "$ACTION" in
+               add)
+                       if [ "`pidof hmland`" = "" ]; then
+                               logger "Starting hmland"
+                               hmland -d
+                       fi
+                       ;;
+               remove)
+                       if [ "`pidof hmland`" != "" ]; then
+                               logger "Stopping hmland"
+                               killall hmland
+                       fi
+                       ;;
+       esac
+fi
index d5ee1938eebb18b7664806f448123d76b4361a40..5a9498df99d096265b87b0b95a70954a3bea2cf2 100644 (file)
@@ -22,6 +22,7 @@ define Package/hmcfgusb/install
        $(INSTALL_DIR) $(1)/usr/bin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/hmland $(1)/usr/bin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/hmsniff $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/20-hmlan.OpenWRT $(1)/etc/hotplug.d/usb/20-hmlan
 endef
 
 $(eval $(call BuildPackage,hmcfgusb))
Impressum, Datenschutz