- uci set "/var/state/network.$ifc.ipaddr=$ip"
- uci set "/var/state/network.$ifc.netmask=${subnet:-255.255.255.0}"
- uci set "/var/state/network.$ifc.dnsdomain=$domain"
- uci set "/var/state/network.$ifc.dns=$dns"
- uci set "/var/state/network.$ifc.gateway=$router"
+ config_get userdns "$ifc" dns
+ [ -n "$userdns" ] && {
+ for i in $userdns; do
+ echo "custom dns $i"
+ echo "nameserver $i" >> "${RESOLV_CONF}.tmp"
+ done
+ dns="$userdns"
+ }
+ uci_set_state network "$ifc" ipaddr "$ip"
+ uci_set_state network "$ifc" netmask "${subnet:-255.255.255.0}"
+ uci_set_state network "$ifc" dnsdomain "$domain"
+ uci_set_state network "$ifc" dns "$dns"
+ uci_set_state network "$ifc" gateway "$router"