diff options
author | Robby Workman <rworkman@slackware.com> | 2017-01-06 15:28:39 -0600 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2017-07-11 16:58:52 -0500 |
commit | f90c679e3ac26bb5047611576850e3253a6c18e2 (patch) | |
tree | ffa5fa8f8605f0e3c1d11ef43bef735e5ed24073 /rc.inet1 | |
parent | 9e0d5e66956a3b80fb4905c96393216fd4a43988 (diff) | |
download | slacknetsetup-f90c679e3ac26bb5047611576850e3253a6c18e2.tar.xz |
rc.inet1: Migrate loopback interface code
Diffstat (limited to 'rc.inet1')
-rw-r--r-- | rc.inet1 | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -51,11 +51,12 @@ fi # already up, do nothing. lo_up() { if grep lo: /proc/net/dev 1> /dev/null ; then - if ! /sbin/ifconfig | grep "^lo" 1> /dev/null ; then - echo "/etc/rc.d/rc.inet1: /sbin/ifconfig lo 127.0.0.1" | $LOGGER - /sbin/ifconfig lo 127.0.0.1 - echo "/etc/rc.d/rc.inet1: /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo" | $LOGGER - /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo + if ! /sbin/ip | grep "^lo" 1> /dev/null ; then + echo "/etc/rc.d/rc.inet1: /sbin/ip ip address add 127.0.0.1/8 dev lo" | $LOGGER + /sbin/ip ip address add 127.0.0.1/8 dev lo + /sbin/ip link set dev lo up + echo "/etc/rc.d/rc.inet1: /sbin/ip route add 127.0.0.0/8 dev lo" | $LOGGER + /sbin/ip route add 127.0.0.0/8 dev lo fi fi } @@ -63,8 +64,8 @@ lo_up() { # Function to take down the loopback interface: lo_down() { if grep lo: /proc/net/dev 1> /dev/null ; then - echo "/etc/rc.d/rc.inet1: /sbin/ifconfig lo down" | $LOGGER - /sbin/ifconfig lo down + echo "/etc/rc.d/rc.inet1: /sbin/ip link set dev lo down" | $LOGGER + /sbin/ip link set dev lo down fi } |