diff --git a/files/etc/config.ap/system b/files/etc/config.ap/system index 868f1606..80147254 100644 --- a/files/etc/config.ap/system +++ b/files/etc/config.ap/system @@ -1,3 +1,17 @@ config 'system' option 'hostname' '' +config button + option button 'reset' + option action 'released' + option handler '/usr/local/bin/bbhnrecoverymode' + option min '3' + option max '7' + +config button + option button 'reset' + option action 'released' + option handler 'firstboot && reboot' + option min '8' + option max '12' + diff --git a/files/etc/config.client/system b/files/etc/config.client/system index 868f1606..80147254 100644 --- a/files/etc/config.client/system +++ b/files/etc/config.client/system @@ -1,3 +1,17 @@ config 'system' option 'hostname' '' +config button + option button 'reset' + option action 'released' + option handler '/usr/local/bin/bbhnrecoverymode' + option min '3' + option max '7' + +config button + option button 'reset' + option action 'released' + option handler 'firstboot && reboot' + option min '8' + option max '12' + diff --git a/files/etc/config.mesh/system b/files/etc/config.mesh/system index 868f1606..80147254 100644 --- a/files/etc/config.mesh/system +++ b/files/etc/config.mesh/system @@ -1,3 +1,17 @@ config 'system' option 'hostname' '' +config button + option button 'reset' + option action 'released' + option handler '/usr/local/bin/bbhnrecoverymode' + option min '3' + option max '7' + +config button + option button 'reset' + option action 'released' + option handler 'firstboot && reboot' + option min '8' + option max '12' + diff --git a/files/etc/config.mesh_ap/system b/files/etc/config.mesh_ap/system index 868f1606..80147254 100644 --- a/files/etc/config.mesh_ap/system +++ b/files/etc/config.mesh_ap/system @@ -1,3 +1,17 @@ config 'system' option 'hostname' '' +config button + option button 'reset' + option action 'released' + option handler '/usr/local/bin/bbhnrecoverymode' + option min '3' + option max '7' + +config button + option button 'reset' + option action 'released' + option handler 'firstboot && reboot' + option min '8' + option max '12' + diff --git a/files/etc/config.router/system b/files/etc/config.router/system index 868f1606..80147254 100644 --- a/files/etc/config.router/system +++ b/files/etc/config.router/system @@ -1,3 +1,17 @@ config 'system' option 'hostname' '' +config button + option button 'reset' + option action 'released' + option handler '/usr/local/bin/bbhnrecoverymode' + option min '3' + option max '7' + +config button + option button 'reset' + option action 'released' + option handler 'firstboot && reboot' + option min '8' + option max '12' + diff --git a/files/etc/config/system b/files/etc/config/system index 2f0b909d..dd85d7cc 100644 --- a/files/etc/config/system +++ b/files/etc/config/system @@ -1,3 +1,16 @@ config 'system' option 'hostname' 'NOCALL' +config button + option button 'reset' + option action 'released' + option handler '/usr/local/bin/bbhnrecoverymode' + option min '3' + option max '7' + +config button + option button 'reset' + option action 'released' + option handler 'firstboot && reboot' + option min '8' + option max '12' diff --git a/files/usr/local/bin/bbhnrecoverymode b/files/usr/local/bin/bbhnrecoverymode index a32be99b..57a47a2c 100644 --- a/files/usr/local/bin/bbhnrecoverymode +++ b/files/usr/local/bin/bbhnrecoverymode @@ -2,14 +2,16 @@ DHCPLANSECTION=`uci show dhcp|grep interface=lan|sed "s/dhcp.\@dhcp\[\(.*\)\].interface=lan/\1/"` -logger "Reseting password to factory default" +logger "BBHN Recovery: Reseting password to BBHN default" /usr/local/bin/setpasswd hsmm -logger "Enable DHCP on lan interface" -uci set dhcp.@dhcp\[$DHCPLANSECTION\].ignore=0 -uci -q commit - -logger "Restart dnsmasq" -/etc/init.d/dnsmasq restart +if [ "$DHCPLANSECTION" != "" ] + then + logger "BBHN Recovery: Enable DHCP on lan interface" + uci set dhcp.@dhcp\[$DHCPLANSECTION\].ignore=0 + uci -q commit + logger "BBHN Recovery: Restart dnsmasq" + /etc/init.d/dnsmasq restart +fi