Browse Source

Properly start and stop signin.sh on package installation and removal.

Clean up package Makefile (it installed and removed too much).
Check-print-parts-order
Wouter R 8 years ago
parent
commit
9e0eab1f8d
  1. 7
      Makefile
  2. 1
      post-install.sh
  3. 9
      post-remove.sh
  4. 1
      pre-remove.sh
  5. 2
      src/FIRMWARE-VERSION
  6. 19
      src/script/wifibox_init

7
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

1
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..."

9
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."

1
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

2
src/FIRMWARE-VERSION

@ -1 +1 @@
0.9.1
0.9.2

19
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"
#}
stop() {
$LOGGER "Stop signing in..."
killall signin.sh
}

Loading…
Cancel
Save