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

pull/1/head
ben 12 months ago
parent 63234790db
commit ed5f0674d5

@ -259,32 +259,40 @@ set_easymesh() {
add_dawn add_dawn
if [ "$ap_mode" = 1 ]; then if [ "$ap_mode" = 1 ]; then
cp /etc/config/wireless /etc/config/wireless.backup cp /etc/config/wireless /etc/config/wireless.backup
cp /etc/config/network /etc/config/network.backup cp /etc/config/network /etc/config/network.backup
uci set wireless.mesh_$apall.mesh_fwding='1' uci set network.lan.type='bridge'
for i in firewall dnsmasq odhcpd; do # assign WAN physical interface to LAN (will be available as an additional LAN port now)
if /etc/init.d/"$i" enabled; then uci set network.lan.ifname="$(uci get network.lan.ifname) $(uci get network.wan.ifname)"
/etc/init.d/"$i" disable uci del network.wan.ifname
/etc/init.d/"$i" stop # Remove wan logical interface, since we will not need it.
fi uci del network.wan
done uci set wireless.mesh_$apall.mesh_fwding='1'
uci commit dhcp; echo '' > /etc/config/dhcp
echo switching the lan interface to DHCP client /etc/init.d/dnsmasq disable
uci set network.lan.proto='dhcp' /etc/init.d/dnsmasq stop
uci delete network.wan
uci delete network.wan6 echo switching the lan interface to DHCP client
uci delete network.lan.ipaddr uci del network.lan.broadcast
uci delete network.lan.netmask uci del network.lan.dns
uci set system.@system[0].hostname=$gateway uci del network.lan.gateway
uci commit uci del network.lan.ipaddr
uci del network.lan.netmask
echo removing firewall config uci set network.lan.proto='dhcp'
mv /etc/config/firewall /etc/config/firewall.restore uci set system.@system[0].hostname=$gateway
uci set network.lan.hostname="`uci get system.@system[0].hostname`"
# reboot the device
uci commit
reboot sync
fi /etc/init.d/network restart
echo removing firewall config
mv /etc/config/firewall /etc/config/firewall.restore
# reboot the device
reboot
fi
else else
ap_mode_stop ap_mode_stop

Loading…
Cancel
Save