From 15bae84ea0ca05f29517832bc7394a3bfa3a9f84 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Sat, 1 Jun 2013 12:01:00 +0200 Subject: [PATCH 1/1] OpenWRT hotplug-script (starts hmland when device is plugged in) --- 20-hmlan.OpenWRT | 20 ++++++++++++++++++++ Makefile.OpenWRT | 1 + 2 files changed, 21 insertions(+) create mode 100644 20-hmlan.OpenWRT 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)) -- 2.39.5