Update 'root/etc/init.d/easymesh'

pull/1/head
ben 1 year ago
parent d820e743f1
commit 5460a81960

@ -79,29 +79,19 @@ add_wifi_mesh() {
fi fi
if [ "$encryption" != 1 ]; then if [ "$encryption" != 1 ]; then
if [ "$mesh_apRadio" == "radio0" ]; then apnum="${mesh_apRadio#radio}"
apnum="0" apnum=$((apnum + 1))
elif [ "$mesh_apRadio" == "radio1" ]; then
apnum="1" # Check all existing wifinetX and remove if SSID matches with $mesh_id
elif [ "$mesh_apRadio" == "radio2" ]; then while uci get wireless.wifinet$apnum > /dev/null 2>&1; do
apnum="2" existing_ssid=$(uci get wireless.wifinet$apnum.ssid 2> /dev/null)
elif [ "$mesh_apRadio" == "radio3" ]; then if [ "$existing_ssid" = "$mesh_id" ]; then
apnum="3" uci delete wireless.wifinet$apnum
elif [ "$mesh_apRadio" == "radio4" ]; then
apnum="4"
elif [ "$mesh_apRadio" == "radio5" ]; then
apnum="5"
elif [ "$mesh_apRadio" == "radio6" ]; then
apnum="6"
elif [ "$mesh_apRadio" == "radio7" ]; then
apnum="7"
elif [ "$mesh_apRadio" == "radio8" ]; then
apnum="8"
elif [ "$mesh_apRadio" == "radio9" ]; then
apnum="9"
elif [ "$mesh_apRadio" == "radio10" ]; then
apnum="10"
fi fi
apnum=$((apnum + 1))
done
uci commit wireless
uci set wireless.mesh_$apall.encryption='none' uci set wireless.mesh_$apall.encryption='none'
uci set wireless.wifinet$apnum=wifi-iface uci set wireless.wifinet$apnum=wifi-iface
uci set wireless.wifinet$apnum.device=$mesh_apRadio uci set wireless.wifinet$apnum.device=$mesh_apRadio
@ -114,32 +104,21 @@ fi
uci set wireless.wifinet$apnum.ft_over_ds='0' uci set wireless.wifinet$apnum.ft_over_ds='0'
uci set wireless.wifinet$apnum.ft_psk_generate_local='1' uci set wireless.wifinet$apnum.ft_psk_generate_local='1'
uci set wireless.wifinet$apnum.network='lan' uci set wireless.wifinet$apnum.network='lan'
#uci delete wireless.$mesh_apRadio.disabled
uci commit wireless uci commit wireless
else else
if [ "$mesh_apRadio" == "radio0" ]; then apnum="${mesh_apRadio#radio}"
apnum="0" apnum=$((apnum + 1))
elif [ "$mesh_apRadio" == "radio1" ]; then
apnum="1" # Check all existing wifinetX and remove if SSID matches with $mesh_id
elif [ "$mesh_apRadio" == "radio2" ]; then while uci get wireless.wifinet$apnum > /dev/null 2>&1; do
apnum="2" existing_ssid=$(uci get wireless.wifinet$apnum.ssid 2> /dev/null)
elif [ "$mesh_apRadio" == "radio3" ]; then if [ "$existing_ssid" = "$mesh_id" ]; then
apnum="3" uci delete wireless.wifinet$apnum
elif [ "$mesh_apRadio" == "radio4" ]; then
apnum="4"
elif [ "$mesh_apRadio" == "radio5" ]; then
apnum="5"
elif [ "$mesh_apRadio" == "radio6" ]; then
apnum="6"
elif [ "$mesh_apRadio" == "radio7" ]; then
apnum="7"
elif [ "$mesh_apRadio" == "radio8" ]; then
apnum="8"
elif [ "$mesh_apRadio" == "radio9" ]; then
apnum="9"
elif [ "$mesh_apRadio" == "radio10" ]; then
apnum="10"
fi fi
apnum=$((apnum + 1))
done
uci commit wireless
uci set wireless.mesh_$apall.encryption='sae' uci set wireless.mesh_$apall.encryption='sae'
uci set wireless.mesh_$apall.key=$key uci set wireless.mesh_$apall.key=$key
uci set wireless.wifinet$apnum=wifi-iface uci set wireless.wifinet$apnum=wifi-iface
@ -153,9 +132,9 @@ fi
uci set wireless.wifinet$apnum.ft_over_ds='0' uci set wireless.wifinet$apnum.ft_over_ds='0'
uci set wireless.wifinet$apnum.ft_psk_generate_local='1' uci set wireless.wifinet$apnum.ft_psk_generate_local='1'
uci set wireless.wifinet$apnum.network='lan' uci set wireless.wifinet$apnum.network='lan'
#uci delete wireless.$mesh_apRadio.disabled
uci commit wireless uci commit wireless
fi fi
} }
add_kvr() { add_kvr() {
@ -271,8 +250,6 @@ done
echo switching the lan interface to DHCP client echo switching the lan interface to DHCP client
uci set network.lan.proto='dhcp' uci set network.lan.proto='dhcp'
uci set network.lan.gateway='$ip4addr'
uci set network.lan.dns='$ip4addr'
uci delete network.wan uci delete network.wan
uci delete network.wan6 uci delete network.wan6
uci delete network.lan.ipaddr uci delete network.lan.ipaddr

Loading…
Cancel
Save