From: Michael Gernoth Date: Sat, 1 Jun 2013 10:01:00 +0000 (+0200) Subject: OpenWRT hotplug-script (starts hmland when device is plugged in) X-Git-Tag: v0.100~90 X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/commitdiff_plain/15bae84ea0ca05f29517832bc7394a3bfa3a9f84 OpenWRT hotplug-script (starts hmland when device is plugged in) --- diff --git a/20-hmlan.OpenWRT b/20-hmlan.OpenWRT new file mode 100644 index 0000000..620244f --- /dev/null +++ b/20-hmlan.OpenWRT @@ -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 diff --git a/Makefile.OpenWRT b/Makefile.OpenWRT index d5ee193..5a9498d 100644 --- a/Makefile.OpenWRT +++ b/Makefile.OpenWRT @@ -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))