aredn/files/usr/local/bin/bbhnrecoverymode

39 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
<<'LICENSE'
Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks
Copyright (C) 2015 Conrad Lara
See Contributors file for additional contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
LICENSE
DHCPLANSECTION=$(uci show dhcp|grep interface=lan|sed "s/dhcp.\@dhcp\[\(.*\)\].interface=lan/\1/")
logger "AREDN(TM) Recovery: Reseting root password to: hsmm"
/usr/local/bin/setpasswd hsmm
logger "AREDN(TM) Recovery: Restarting uhttpd"
/etc/init.d/uhttpd restart
if [ "$DHCPLANSECTION" != "" ]
then
logger "AREDN(TM) Recovery: Enable DHCP on lan interface"
uci set "dhcp.@dhcp\[$DHCPLANSECTION\].ignore=0"
uci -q commit
logger "AREDN(TM) Recovery: Restart dnsmasq"
/etc/init.d/dnsmasq restart
fi