Merge branch 'resetbuttonupgrade' into develop

This commit is contained in:
Conrad Lara - KG6JEI 2014-09-12 12:04:58 -07:00
commit 1087443285
8 changed files with 124 additions and 0 deletions

View File

@ -1,3 +1,17 @@
config 'system'
option 'hostname' '<NODE>'
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'

View File

@ -1,3 +1,17 @@
config 'system'
option 'hostname' '<NODE>'
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'

View File

@ -1,3 +1,17 @@
config 'system'
option 'hostname' '<NODE>'
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'

View File

@ -1,3 +1,17 @@
config 'system'
option 'hostname' '<NODE>'
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'

View File

@ -1,3 +1,17 @@
config 'system'
option 'hostname' '<NODE>'
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'

View File

@ -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'

View File

@ -0,0 +1,24 @@
. /lib/functions.sh
do_button () {
local button
local action
local handler
local min
local max
config_get button $1 button
config_get action $1 action
config_get handler $1 handler
config_get min $1 min
config_get max $1 max
[ "$ACTION" = "$action" -a "$BUTTON" = "$button" -a -n "$handler" ] && {
[ -z "$min" -o -z "$max" ] && eval $handler
[ -n "$min" -a -n "$max" ] && {
[ $min -le $SEEN -a $max -ge $SEEN ] && eval $handler
}
}
}
config_load system
config_foreach do_button button

View File

@ -0,0 +1,17 @@
#!/bin/sh
DHCPLANSECTION=`uci show dhcp|grep interface=lan|sed "s/dhcp.\@dhcp\[\(.*\)\].interface=lan/\1/"`
logger "BBHN Recovery: Reseting password to BBHN default"
/usr/local/bin/setpasswd hsmm
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