diff --git a/Makefile b/Makefile index 5cb4b83..f47d81e 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,8 @@ define Package/wifibox/install $(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/d3d-updater.lua $(1)/$(TGT_LUA_DIR_SUFFIX)/script $(LN) -s /$(TGT_LUA_DIR_SUFFIX)/script/d3d-updater.lua $(1)/bin/d3d-updater - $(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/wifibox_init $(1)/etc/init.d/wifibox # copy directly to init dir (required for post-inst enabling) + $(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/wifibox_init $(1)/etc/init.d/wifibox + $(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/dhcpcheck_init $(1)/etc/init.d/dhcpcheck $(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/d3dapi $(1)/$(TGT_LUA_DIR_SUFFIX)/script $(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/signin.sh $(1)/$(TGT_LUA_DIR_SUFFIX)/script diff --git a/post-install.sh b/post-install.sh index 6bf66ca..2ece974 100644 --- a/post-install.sh +++ b/post-install.sh @@ -74,6 +74,7 @@ echo "/root/sketches" >> /etc/sysupgrade.conf $IPKG_INSTROOT/etc/init.d/wifibox enable $IPKG_INSTROOT/etc/init.d/wifibox start +$IPKG_INSTROOT/etc/init.d/dhcpcheck enable if [ -z "$IPKG_INSTROOT" ]; then echo "Enabling wifi device..." diff --git a/src/script/dhcpcheck_init b/src/script/dhcpcheck_init new file mode 100755 index 0000000..11b05c5 --- /dev/null +++ b/src/script/dhcpcheck_init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common + +# start after all other scripts +START=99 + +LOGGER="logger -t dhcpcheck -p 6" + +boot() { + logread | grep "192.168.10.249, lease time 12h" + if [ $? -ne 0 ]; then + $LOGGER "Applying workaround for dhcp/dnsmasq issue. See: https://github.com/Doodle3D/doodle3d-client/issues/66" + /etc/init.d/dnsmasq reload + else + $LOGGER "DHCP configuration is in order, not doing anything" + fi +} diff --git a/src/script/wifibox_init b/src/script/wifibox_init index 9499b85..81f9f81 100755 --- a/src/script/wifibox_init +++ b/src/script/wifibox_init @@ -3,7 +3,7 @@ # start after networking START=22 -LOGGER="logger -s -t autowifi -p 6" +LOGGER="logger -t autowifi -p 6" boot() { sleep 1