Forgot to save

main
Jason Hawks 1 year ago
parent 02799a6359
commit fc45fc736c

@ -2,8 +2,9 @@
# Dumb AP Mode Block # Dumb AP Mode Block
set_apmode() { set_apmode() {
AP_MODE=$(uci -q get easymesh.config.ap_mode) touch /root/.madeap
if [ "$AP_MODE" = 1 ]; then # AP_MODE=$(uci -q get easymesh.config.ap_mode)
# if [ "$AP_MODE" = 1 ]; then
# Set a flag to indicate that we are in AP mode # Set a flag to indicate that we are in AP mode
# When we go to disable easymesh, we will check this flag and if it was set we restore settings # When we go to disable easymesh, we will check this flag and if it was set we restore settings
uci set easymesh.config.ap_mode_enabled=1 uci set easymesh.config.ap_mode_enabled=1
@ -71,38 +72,38 @@ set_apmode() {
# Tell openwrt to reload the configs # Tell openwrt to reload the configs
reload_config reload_config
/etc/init.d/network reload /etc/init.d/network reload
else # else
# Set a flag to indicate that we are in AP mode # # Set a flag to indicate that we are in AP mode
uci set easymesh.config.ap_mode_enabled=0 # uci set easymesh.config.ap_mode_enabled=0
# Restore our configs # # Restore our configs
[ -f /etc/config/wireless.meshbak ] && { # [ -f /etc/config/wireless.meshbak ] && {
mv /etc/config/wireless /etc/config/wireless.dumbap # mv /etc/config/wireless /etc/config/wireless.dumbap
cp /etc/config/wireless.meshbak /etc/config/wireless # cp /etc/config/wireless.meshbak /etc/config/wireless
} # }
[ -f /etc/config/network.meshbak ] && { # [ -f /etc/config/network.meshbak ] && {
mv /etc/config/network /etc/config/network.dumbap # mv /etc/config/network /etc/config/network.dumbap
cp /etc/config/network.meshbak /etc/config/network # cp /etc/config/network.meshbak /etc/config/network
} # }
[ -f /etc/config/dhcp.meshbak ] && { # [ -f /etc/config/dhcp.meshbak ] && {
mv /etc/config/dhcp /etc/config/dhcp.dumbap # mv /etc/config/dhcp /etc/config/dhcp.dumbap
cp /etc/config/dhcp.meshbak /etc/config/dhcp # cp /etc/config/dhcp.meshbak /etc/config/dhcp
} # }
# Enable and start services not needed # # Enable and start services not needed
for service in firewall dnsmasq odhcpd; do # for service in firewall dnsmasq odhcpd; do
if /etc/init.d/$service disabled; then # if /etc/init.d/$service disabled; then
echo "Enabling and starting $service..." # echo "Enabling and starting $service..."
/etc/init.d/$service enable # /etc/init.d/$service enable
/etc/init.d/$service start # /etc/init.d/$service start
else # else
echo "$service is not disabled, skipping..." # echo "$service is not disabled, skipping..."
fi # fi
done # done
reload_config # reload_config
/etc/init.d/network reload # /etc/init.d/network reload
fi # fi
} }
clear_mesh_radio() { clear_mesh_radio() {

Loading…
Cancel
Save