WIP commit

main
Jason Hawks 10 months ago
parent 9e5df69308
commit cc83509958

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

Loading…
Cancel
Save