From ce043de28e65471e8b1cd64dce9206d3b3dca33e Mon Sep 17 00:00:00 2001 From: Wouter R Date: Fri, 29 Nov 2013 21:14:59 +0100 Subject: [PATCH] =?UTF-8?q?Workaround=20for=20issue=2066=20(https://github?= =?UTF-8?q?.com/Doodle3D/doodle3d-client/issues/66).=20Remove=20=E2=80=98-?= =?UTF-8?q?s=E2=80=99=20flag=20in=20wifibox=20init=20script=20to=20prevent?= =?UTF-8?q?=20duplicates=20log=20messages.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 3 ++- post-install.sh | 1 + src/script/dhcpcheck_init | 16 ++++++++++++++++ src/script/wifibox_init | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 src/script/dhcpcheck_init 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