summaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-18 11:39:59 -0400
committerDave Reisner <d@falconindy.com>2011-06-18 12:18:04 -0400
commit4cad51425325abf13b7a8772ff09f852238423c2 (patch)
treeec8ffc6bf603cbca8b78d144e5ded0c700245cf7 /network
parent590ee44c1495ea67d057e0d21e4ebc25c0e17782 (diff)
network: support gateway-less network setup
This also discards the explicit deletion of the route in network_down, as bringing down the interface will take care of this for us. Addresses FS#24690 Thanks-to: Matthias Dienstbier <matthias_dienstbier@yahoo.de> Signed-off-by: Dave Reisner <d@falconindy.com>
Diffstat (limited to 'network')
-rwxr-xr-xnetwork3
1 files changed, 1 insertions, 2 deletions
diff --git a/network b/network
index c2ad9ba..38ada9a 100755
--- a/network
+++ b/network
@@ -33,7 +33,7 @@ network_up() {
fi
done
ip addr add $address/$netmask broadcast ${broadcast:-+} dev $interface || return 1
- ip route add default via $gateway || return 1
+ [[ $gateway ]] && { ip route add default via $gateway || return 1; }
else
dhcpcd $DHCPCD_ARGS $interface || return 1
fi
@@ -43,7 +43,6 @@ network_down() {
if [[ -f /var/run/dhcpcd-$interface.pid ]]; then
dhcpcd -k $interface || return 1
else
- ip route del default || return 1
ip addr flush dev $interface || return 1
fi