0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-12-22 19:13:49 +01:00

Merge pull request #62 from Doodle3D/feature/button-switch-wificonfig

Feature/button switch wificonfig
This commit is contained in:
Peter Uithoven 2016-05-25 10:20:43 +02:00
commit ae036af172
4 changed files with 30 additions and 1 deletions

View File

@ -101,6 +101,10 @@ define Package/wifibox/install
#$(INSTALL_DIR) $(1)/www #$(INSTALL_DIR) $(1)/www
$(INSTALL_DIR) $(1)/www/cgi-bin $(INSTALL_DIR) $(1)/www/cgi-bin
#copy wps button script to procd folder
$(INSTALL_DIR) $(1)/etc/rc.button/
$(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/wifi-switch-netconfig.sh $(1)/etc/rc.button/wps
### create all files in /usr/share/lua/autowifi (autowifi) ### create all files in /usr/share/lua/autowifi (autowifi)
$(CP) $(WIFIBOX_BASE_DIR)/opkg.conf $(1)/$(TGT_LUA_DIR_SUFFIX)/ $(CP) $(WIFIBOX_BASE_DIR)/opkg.conf $(1)/$(TGT_LUA_DIR_SUFFIX)/
@ -118,6 +122,7 @@ define Package/wifibox/install
$(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/wifibox_init $(1)/etc/init.d/wifibox $(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/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/d3dapi $(1)/$(TGT_LUA_DIR_SUFFIX)/script
$(LN) -s /$(TGT_LUA_DIR_SUFFIX)/script/d3dapi $(1)/bin/d3dapi
$(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/signin.sh $(1)/$(TGT_LUA_DIR_SUFFIX)/script $(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/signin.sh $(1)/$(TGT_LUA_DIR_SUFFIX)/script
$(CP) $(WIFIBOX_BASE_DIR)/script/logrotate-wifibox.conf $(1)/etc/logrotate.d/wifibox.conf $(CP) $(WIFIBOX_BASE_DIR)/script/logrotate-wifibox.conf $(1)/etc/logrotate.d/wifibox.conf

View File

@ -55,7 +55,6 @@ if [ $? -gt 0 ]; then
cat <<-\EOM >> $IPKG_INSTROOT/root/.profile cat <<-\EOM >> $IPKG_INSTROOT/root/.profile
# DO NOT MODIFY - this block of lines has been added by the wifibox package. # DO NOT MODIFY - this block of lines has been added by the wifibox package.
alias d='ls -la' alias d='ls -la'
alias d3dapi='/usr/share/lua/wifibox/script/d3dapi'
alias encore='ulimit -c unlimited' alias encore='ulimit -c unlimited'
alias wopkg='opkg -f /usr/share/lua/wifibox/opkg.conf' alias wopkg='opkg -f /usr/share/lua/wifibox/opkg.conf'

View File

@ -218,4 +218,17 @@ function M.alive(request, response)
response:setSuccess("alive") response:setSuccess("alive")
end end
function M.reset_POST(request, response)
response:setSuccess("Resetting networks")
log:info(MOD_ABBR, "Resetting networks")
for _, net in ipairs(wifi.getConfigs()) do
wifi.removeConfig(net.ssid)
end
local ssid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid'))
netconf.setupAccessPoint(ssid)
netconf.enableAccessPoint(ssid)
end
return M return M

View File

@ -0,0 +1,12 @@
#!/bin/sh
[ "${ACTION}" = "released" ] || exit 0
. /lib/functions.sh
logger "$BUTTON pressed for $SEEN seconds"
if [ "$SEEN" -gt 4 ]
then
logger "Resetting Wireless"
d3dapi p=/network/reset r=POST
fi