ipcalc -s "$if_netmask" || return
$DEBUG ifconfig $if $if_ip netmask $if_netmask up
- ipcalc -s "$ip_gateway" || return
- $DEBUG route add default gw $ip_gateway
+ ipcalc -s "$if_gateway" || return
+ $DEBUG route add default gw $if_gateway
+
+ [ -f /etc/resolv.conf ] && return
+
+ echo "# --- creating /etc/resolv.conf ---"
+ for dns in $(nvram_get ${type}_dns); do {
+ echo "nameserver $dns" >> /etc/resolv.conf
+ }; done
;;
dhcp)
pidfile=/tmp/dhcp-${type}.pid
configure lan
configure wifi
configure wan
+
+for route in $(nvram_get static_route); do {
+ ip=${route%%:*} route=${route#*:}
+ netmask=${route%%:*} route=${route#*:}
+ gateway=${route%%:*} route=${route#*:}
+ metric=${route%%:*} route=${route#*:}
+ if=${route%%:*}
+ $DEBUG route add -net $ip netmask $netmask gw $gateway metric $metric dev $if
+} done