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

pull/1/head
ben 1 year ago
parent bc0bd6ac1e
commit a76a07eda9

@ -189,31 +189,44 @@ set_easymesh() {
add_dawn add_dawn
if [ "$ap_mode" = 1 ]; then if [ "$ap_mode" = 1 ]; then
uci set network.lan.proto='dhcp' #backup wireless
uci delete network.lan.ipaddr cp /etc/config/wireless /etc/config/wireless.backup
uci delete network.lan.netmask #backup network
uci delete network.lan.gateway cp /etc/config/network /etc/config/network.backup
uci -q delete network.lan.dns
# these services do not run on dumb APs
uci add_list network.lan.dns=$gateway # assuming gateway IP is the DNS server for i in firewall dnsmasq odhcpd; do
uci add_list network.lan.gateway=$gateway # set gateway as the DHCP server if /etc/init.d/"$i" enabled; then
/etc/init.d/"$i" disable
uci add_list network.lan.ifname='bat0' # add bat0 to LAN interface list /etc/init.d/"$i" stop
uci commit network fi
done
echo "" > /etc/easymesh
uci set dhcp.lan.ignore='1' # ignore interface for serving DHCP # Now switch the lan interface to DHCP client
uci -q delete dhcp.lan.ra echo switching the lan interface to DHCP client
uci -q delete dhcp.lan.dhcpv6 uci set network.lan.proto='dhcp'
uci -q delete dhcp.lan.ra_management uci delete network.wan
uci commit dhcp uci delete network.wan6
uci delete network.lan.ipaddr
/etc/init.d/odhcpd stop && /etc/init.d/odhcpd disable uci delete network.lan.netmask
/etc/init.d/dnsmasq restart # Restarting dnsmasq to apply DHCP client settings
/etc/init.d/network reload # Reloading network to apply the new network settings # change the host name to easymesh node
echo changing the hostname to easymesh
/etc/init.d/firewall stop && /etc/init.d/firewall disable >/dev/null 2>&1 uci set system.@system[0].hostname=$gateway
# commit all changes
uci commit
# remove the firewall config
echo removing firewall config
mv /etc/config/firewall /etc/config/firewall.restore
# reboot the device
reboot
fi fi
else else

Loading…
Cancel
Save