From cc83509958616babb598fb28f5c38e3accf7f2c2 Mon Sep 17 00:00:00 2001 From: Jason Hawks Date: Tue, 14 Nov 2023 19:36:06 -0500 Subject: [PATCH] WIP commit --- root/easymesh/dumbap.sh | 0 root/easymesh/easymesh.sh | 40 +++++++++++++++++++-------------------- 2 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 root/easymesh/dumbap.sh diff --git a/root/easymesh/dumbap.sh b/root/easymesh/dumbap.sh new file mode 100644 index 0000000..e69de29 diff --git a/root/easymesh/easymesh.sh b/root/easymesh/easymesh.sh index d5e9516..2d35e95 100644 --- a/root/easymesh/easymesh.sh +++ b/root/easymesh/easymesh.sh @@ -65,7 +65,6 @@ clear_mesh_radio() { # Commit changes to make sure the wireless configuration is updated uci commit wireless # Restart wireless to apply changes - wifi reload wifi up echo "Wireless interfaces reloaded." } @@ -292,7 +291,6 @@ restart_and_reload() { uci commit wireless # Reload wifi to apply changes without restarting all interfaces - wifi reload wifi up echo "Wireless interfaces reloaded." @@ -361,7 +359,7 @@ set_apmode() { uci del dhcp.wan # Fix this for proper variable name - HOSTNAME=$(uci -q get easymesh.config.gateway) + HOSTNAME=$(uci -q get easymesh.config.hostname) # Set netmask and gateway (assuming $netmask and $dns didn't break more stuff) uci set system.@system[0].hostname=$HOSTNAME @@ -388,13 +386,13 @@ set_apmode() { RADIO_LIST=$AP_RADIO fi - # Loop through the selected radios - for CURRENT_RADIO in $RADIO_LIST; do - echo "Multiple Radio Setup, Current Radio: $CURRENT_RADIO" - # Extact the radio number from the radio name - wifi_num="${cur_radio#CURRENT_RADIO}" - uci set wireless.wifinet${wifi_num}.network="lan nwi_mesh_${cur_radio}" - done + # # Loop through the selected radios + # for CURRENT_RADIO in $RADIO_LIST; do + # echo "Multiple Radio Setup, Current Radio: $CURRENT_RADIO" + # # Extact the radio number from the radio name + # wifi_num="${cur_radio#CURRENT_RADIO}" + # uci set wireless.wifinet${wifi_num}.network="lan private_router_batman" + # done uci commit # Tell openwrt to reload the configs @@ -434,20 +432,22 @@ set_apmode() { fi } -# We accept the parameters: start, stop and apmode -# start: Enables easymesh -# stop: Disables easymesh -# apmode: Sets the device to AP mode -if [ "$1" = "start" ]; then +# Enable easymesh +enable_easymesh() { clear_mesh_radio create_batman_network process_radios restart_and_reload -elif [ "$1" = "stop" ]; then +} + +# Disable easymesh +disable_easymesh() { clear_mesh_radio disable_batman_interfaces -# elif [ "$1" = "apmode" ]; then -# set_apmode -else - echo "Invalid parameter passed." +} + +# Check if enabled +if [ "$(uci -q get easymesh.config.enabled)" = 0 ]; then + echo "Easymesh is disabled, exiting." + exit 1 fi