From 9e0eab1f8df7fdb02cac6c75ed161c702c199f0f Mon Sep 17 00:00:00 2001 From: Wouter R Date: Tue, 22 Oct 2013 22:44:51 +0200 Subject: [PATCH] Properly start and stop signin.sh on package installation and removal. Clean up package Makefile (it installed and removed too much). --- Makefile | 7 ++----- post-install.sh | 1 + post-remove.sh | 9 +-------- pre-remove.sh | 1 + src/FIRMWARE-VERSION | 2 +- src/script/wifibox_init | 19 ++++++++++++------- 6 files changed, 18 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 0e71e86..49f72d3 100644 --- a/Makefile +++ b/Makefile @@ -109,11 +109,8 @@ define Package/wifibox/install $(CP) $(WIFIBOX_BASE_DIR)/FIRMWARE-VERSION $(1)/etc/wifibox-version ifeq ($(CONFIG_WIFIBOX_DEVEL_PACKAGE),y) -# $(INSTALL_DIR) $(1)/$(TGT_LUA_DIR_SUFFIX)/misc -# $(CP) $(WIFIBOX_BASE_DIR)/../misc/collect-code.sh $(1)/$(TGT_LUA_DIR_SUFFIX)/misc/ - - $(INSTALL_DIR) $(1)/$(TGT_LUA_DIR_SUFFIX)/test - $(CP) $(WIFIBOX_BASE_DIR)/test/* $(1)/$(TGT_LUA_DIR_SUFFIX)/test/ +# $(INSTALL_DIR) $(1)/$(TGT_LUA_DIR_SUFFIX)/test +# $(CP) $(WIFIBOX_BASE_DIR)/test/* $(1)/$(TGT_LUA_DIR_SUFFIX)/test/ # $(LN) -s /$(TGT_LUA_DIR_SUFFIX)/test $(1)/www/ endif diff --git a/post-install.sh b/post-install.sh index 6e33c11..a0f6640 100644 --- a/post-install.sh +++ b/post-install.sh @@ -70,6 +70,7 @@ fi ### Finally make sure basic configuration is set correctly $IPKG_INSTROOT/etc/init.d/wifibox enable +$IPKG_INSTROOT/etc/init.d/wifibox start if [ -z "$IPKG_INSTROOT" ]; then echo "Enabling wifi device..." diff --git a/post-remove.sh b/post-remove.sh index a024576..04fe392 100644 --- a/post-remove.sh +++ b/post-remove.sh @@ -14,14 +14,7 @@ rmdir /usr/share/lua/wifibox/util rmdir /usr/share/lua/wifibox rmdir /usr/share/lua -# Try to remove all www directories used by the package, and intentionally leave anything non-empty alone -rmdir /www/js/libs -rmdir /www/js -rmdir /www/img/buttons -rmdir /www/img -rmdir /www/css -rm /www/test 2> /dev/null -rmdir /www/cgi-bin +#rm /www/test 2> /dev/null echo "The wifibox banner has been removed. Changes to the root profile however, have" echo "not been reverted, as haven't the wlan firewall zone and the radio0 device state." diff --git a/pre-remove.sh b/pre-remove.sh index f39ecfa..8884b7b 100644 --- a/pre-remove.sh +++ b/pre-remove.sh @@ -1,5 +1,6 @@ #!/bin/sh +$IPKG_INSTROOT/etc/init.d/wifibox stop $IPKG_INSTROOT/etc/init.d/wifibox disable exit 0 diff --git a/src/FIRMWARE-VERSION b/src/FIRMWARE-VERSION index f374f66..2003b63 100644 --- a/src/FIRMWARE-VERSION +++ b/src/FIRMWARE-VERSION @@ -1 +1 @@ -0.9.1 +0.9.2 diff --git a/src/script/wifibox_init b/src/script/wifibox_init index d766af6..9499b85 100755 --- a/src/script/wifibox_init +++ b/src/script/wifibox_init @@ -10,15 +10,20 @@ boot() { $LOGGER "Invoking Doodle3D WiFi box network auto-initialization..." /usr/share/lua/wifibox/script/d3dapi autowifi - + $LOGGER "Start signing in..." /usr/share/lua/wifibox/script/signin.sh > /dev/null 2> /dev/null & } -#start() { -# $LOGGER "dummy start" -#} +start() { + ps | awk '{print $5}' | grep '{signin.sh}' + if [ $? -eq 1 ]; then + $LOGGER "Start signing in..." + /usr/share/lua/wifibox/script/signin.sh > /dev/null 2> /dev/null & + fi +} -#stop() { -# $LOGGER "dummy stop" -#} \ No newline at end of file +stop() { + $LOGGER "Stop signing in..." + killall signin.sh +}