diff options
author | Robby Workman <rworkman@slackware.com> | 2017-01-07 19:10:49 -0600 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2017-07-11 16:58:52 -0500 |
commit | e392f00ff431347d3b8a367ccbffc75ab33cd9d2 (patch) | |
tree | dcb0e00dcac34c357c59160e15c66024159fb6da /rc.inet1 | |
parent | b6d44a0ea3113f6d4f86022ca98bdfd6ad08f72c (diff) | |
download | slacknetsetup-e392f00ff431347d3b8a367ccbffc75ab33cd9d2.tar.xz |
rc.inet1: migrate gateway functions
Diffstat (limited to 'rc.inet1')
-rw-r--r-- | rc.inet1 | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 } |