summaryrefslogtreecommitdiffstats
path: root/rc.inet1
diff options
context:
space:
mode:
Diffstat (limited to 'rc.inet1')
-rw-r--r--rc.inet112
1 files changed, 6 insertions, 6 deletions
diff --git a/rc.inet1 b/rc.inet1
index 1326224..cd18729 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -228,19 +228,19 @@ if_down() {
# Function to bring up the gateway if there is not yet a default route:
gateway_up() {
- if ! /sbin/route -n | grep "^0.0.0.0" 1> /dev/null ; then
+ if ! /sbin/ip route show | grep -wq default ; then
if [ ! "$GATEWAY" = "" ]; then
- echo "/etc/rc.d/rc.inet1: /sbin/route add default gw ${GATEWAY} metric 1" | $LOGGER
- /sbin/route add default gw ${GATEWAY} metric 1 2>&1 | $LOGGER
+ echo "/etc/rc.d/rc.inet1: /sbin/ip route add default via ${GATEWAY}" | $LOGGER
+ /sbin/ip route add default via ${GATEWAY} | $LOGGER
fi
fi
}
# Function to take down an existing default gateway:
gateway_down() {
- if /sbin/route -n | grep "^0.0.0.0" 1> /dev/null ; then
- echo "/etc/rc.d/rc.inet1: /sbin/route del default" | $LOGGER
- /sbin/route del default
+ if /sbin/ip route show | grep -wq default ; then
+ echo "/etc/rc.d/rc.inet1: /sbin/ip route del default" | $LOGGER
+ /sbin/ip route del default
fi
}