|
|
@ -188,27 +188,33 @@ set_easymesh() {
|
|
|
|
add_dawn
|
|
|
|
add_dawn
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$ap_mode" = 1 ]; then
|
|
|
|
if [ "$ap_mode" = 1 ]; then
|
|
|
|
if [ "$ap_ipaddr" != "$ipaddr" ]; then
|
|
|
|
uci set network.lan.proto='dhcp'
|
|
|
|
uci set network.lan.ipaddr=$ipaddr
|
|
|
|
uci delete network.lan.ipaddr
|
|
|
|
uci set network.lan.netmask=$netmask
|
|
|
|
uci delete network.lan.netmask
|
|
|
|
uci set network.lan.gateway=$gateway
|
|
|
|
uci delete network.lan.gateway
|
|
|
|
uci add_list network.lan.dns=$dns
|
|
|
|
uci -q delete network.lan.dns
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uci add_list network.lan.dns=$gateway # assuming gateway IP is the DNS server
|
|
|
|
|
|
|
|
uci add_list network.lan.gateway=$gateway # set gateway as the DHCP server
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uci add_list network.lan.ifname='bat0' # add bat0 to LAN interface list
|
|
|
|
uci commit network
|
|
|
|
uci commit network
|
|
|
|
|
|
|
|
|
|
|
|
echo "" >/etc/easymesh
|
|
|
|
echo "" > /etc/easymesh
|
|
|
|
echo "$ipaddr" >/etc/easymesh
|
|
|
|
|
|
|
|
echo "$dns" >>/etc/easymesh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uci set dhcp.lan.dynamicdhcp='0'
|
|
|
|
uci set dhcp.lan.ignore='1' # ignore interface for serving DHCP
|
|
|
|
uci set dhcp.lan.ignore='1'
|
|
|
|
|
|
|
|
uci -q delete dhcp.lan.ra
|
|
|
|
uci -q delete dhcp.lan.ra
|
|
|
|
uci -q delete dhcp.lan.dhcpv6
|
|
|
|
uci -q delete dhcp.lan.dhcpv6
|
|
|
|
uci -q delete dhcp.lan.ra_management
|
|
|
|
uci -q delete dhcp.lan.ra_management
|
|
|
|
uci commit dhcp
|
|
|
|
uci commit dhcp
|
|
|
|
|
|
|
|
|
|
|
|
/etc/init.d/odhcpd stop && /etc/init.d/odhcpd disable
|
|
|
|
/etc/init.d/odhcpd stop && /etc/init.d/odhcpd disable
|
|
|
|
|
|
|
|
/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
|
|
|
|
|
|
|
|
|
|
|
|
/etc/init.d/firewall stop && /etc/init.d/firewall disable >/dev/null 2>&1
|
|
|
|
/etc/init.d/firewall stop && /etc/init.d/firewall disable >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ap_mode_stop
|
|
|
|
ap_mode_stop
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|