@ -26,18 +26,29 @@ set_apmode() {
fi
fi
done
done
# Set LAN interface to DHCP client
if [ $( uci -q get easymesh.config.ipmode) = = "static" ] ; then
uci del network.lan.ipaddr
# Set static IP
uci del network.lan.netmask
uci set network.lan.proto= 'static'
uci set network.lan.proto= 'dhcp'
uci set network.lan.ipaddr= $( uci -q get easymesh.config.ipaddr)
uci set network.lan.netmask= $( uci -q get easymesh.config.netmask)
uci set network.lan.gateway= $( uci -q get easymesh.config.gatewayIP)
uci set network.lan.dns= '1.1.1.1'
else
# Set LAN interface to DHCP client
uci del network.lan.ipaddr
uci del network.lan.netmask
uci set network.lan.proto= 'dhcp'
fi
# Delete wan interfaces
uci del network.wan
uci del network.wan
uci del network.wan6
uci del network.wan6
# Fix firewall to be disabled
# Set firewall disabled
uci del firewall.lan.network
uci del firewall.lan.network
uci del firewall.wan.network
uci del firewall.wan.network
# Fix dhcp to be disabled
# Just in case, set lan to be ignored by dhcp
uci set dhcp.lan.ignore= '1'
uci set dhcp.lan.ignore= '1'
uci del dhcp.wan
uci del dhcp.wan
@ -60,6 +71,31 @@ set_apmode() {
# Get the radio to be used for mesh from the config
# Get the radio to be used for mesh from the config
AP_RADIO = $( uci -q get easymesh.config.apRadio)
AP_RADIO = $( uci -q get easymesh.config.apRadio)
# Our config set mesh_id that we are looking for
MESH_ID = $( uci -q get easymesh.config.mesh_id)
# Check if MESH_NAME and AP_RADIO are set, if so find set our network
if [ ! -z " $AP_RADIO " ] || [ ! -z " $MESH_ID " ] ; then
# Get the output from uci show wireless
uci_output = $( uci show wireless)
# Find the wireless network with the matching ssid and delete it
ssid = $( echo " $uci_output " | grep -o " wireless\.wifinet[0-9]*\.ssid=' $MESH_ID ' " )
if [ ! -z " $ssid " ] ; then
# Loop through radios and delete the wireless networks
for radio in $AP_RADIO ; do
# Get the number from the radio name
radio_num = " ${ radio #radio } "
# Delete the network
#uci del wireless.wifinet$radio_num
echo " Found wireless network with ssid ' $MESH_NAME ' on radio $radio_num "
done
fi
fi
# # Loop through the selected radios
# # Loop through the selected radios
# for CURRENT_RADIO in $AP_RADIO; do
# for CURRENT_RADIO in $AP_RADIO; do
# echo "Multiple Radio Setup, Current Radio: $CURRENT_RADIO"
# echo "Multiple Radio Setup, Current Radio: $CURRENT_RADIO"