From fc45fc736c4f85e9cb9276643f8abd657571daed Mon Sep 17 00:00:00 2001 From: Jason Hawks Date: Wed, 15 Nov 2023 12:50:32 -0500 Subject: [PATCH] Forgot to save --- root/easymesh/easymesh.sh | 69 ++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/root/easymesh/easymesh.sh b/root/easymesh/easymesh.sh index 3569e36..bfbbe4c 100644 --- a/root/easymesh/easymesh.sh +++ b/root/easymesh/easymesh.sh @@ -2,8 +2,9 @@ # Dumb AP Mode Block set_apmode() { - AP_MODE=$(uci -q get easymesh.config.ap_mode) - if [ "$AP_MODE" = 1 ]; then + touch /root/.madeap + # 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 # 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 @@ -71,38 +72,38 @@ set_apmode() { # Tell openwrt to reload the configs reload_config /etc/init.d/network reload - else - # Set a flag to indicate that we are in AP mode - uci set easymesh.config.ap_mode_enabled=0 - - # Restore our configs - [ -f /etc/config/wireless.meshbak ] && { - mv /etc/config/wireless /etc/config/wireless.dumbap - cp /etc/config/wireless.meshbak /etc/config/wireless - } - [ -f /etc/config/network.meshbak ] && { - mv /etc/config/network /etc/config/network.dumbap - cp /etc/config/network.meshbak /etc/config/network - } - [ -f /etc/config/dhcp.meshbak ] && { - mv /etc/config/dhcp /etc/config/dhcp.dumbap - cp /etc/config/dhcp.meshbak /etc/config/dhcp - } - - # Enable and start services not needed - for service in firewall dnsmasq odhcpd; do - if /etc/init.d/$service disabled; then - echo "Enabling and starting $service..." - /etc/init.d/$service enable - /etc/init.d/$service start - else - echo "$service is not disabled, skipping..." - fi - done - - reload_config - /etc/init.d/network reload - fi + # else + # # Set a flag to indicate that we are in AP mode + # uci set easymesh.config.ap_mode_enabled=0 + + # # Restore our configs + # [ -f /etc/config/wireless.meshbak ] && { + # mv /etc/config/wireless /etc/config/wireless.dumbap + # cp /etc/config/wireless.meshbak /etc/config/wireless + # } + # [ -f /etc/config/network.meshbak ] && { + # mv /etc/config/network /etc/config/network.dumbap + # cp /etc/config/network.meshbak /etc/config/network + # } + # [ -f /etc/config/dhcp.meshbak ] && { + # mv /etc/config/dhcp /etc/config/dhcp.dumbap + # cp /etc/config/dhcp.meshbak /etc/config/dhcp + # } + + # # Enable and start services not needed + # for service in firewall dnsmasq odhcpd; do + # if /etc/init.d/$service disabled; then + # echo "Enabling and starting $service..." + # /etc/init.d/$service enable + # /etc/init.d/$service start + # else + # echo "$service is not disabled, skipping..." + # fi + # done + + # reload_config + # /etc/init.d/network reload + # fi } clear_mesh_radio() {