summaryrefslogtreecommitdiffstats
path: root/rc.inet1
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2018-07-25 16:37:15 +0100
committerRobby Workman <rworkman@slackware.com>2018-11-25 14:17:50 -0600
commit2e95f250e5634b3c6e5a1a9d13a0e3a3310dc566 (patch)
treee4341a2e6cce21848ef0619f677ea0415e0ebf82 /rc.inet1
parentfe0c8a2406fe413248073159883b7e531ccc5496 (diff)
downloadslacknetsetup-2e95f250e5634b3c6e5a1a9d13a0e3a3310dc566.tar.xz
Account for IPv6 addresses in determination of interface status
Signed-off-by: Robby Workman <rworkman@slackware.com>
Diffstat (limited to 'rc.inet1')
-rw-r--r--rc.inet14
1 files changed, 2 insertions, 2 deletions
diff --git a/rc.inet1 b/rc.inet1
index 6f1532e..cfd8d10 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -155,8 +155,8 @@ if_up() {
fi
fi
if [ -e /sys/class/net/${1%%:*} ]; then # interface exists
- if ! /sbin/ip address show dev ${1} 2>/dev/null | grep -wq inet || \
- ! /sbin/ip link show dev ${1} | grep -wq "state UP" ; then # interface not up or not configured
+ if ! /sbin/ip address show permanent scope global dev ${1} 2>/dev/null | grep -Ewq '(inet|inet6)' || \
+ ! /sbin/ip link show dev ${1} | grep -wq "state UP" ; then # interface not up or not configured
if [ -n "${HWADDR[$i]}" ]; then # Set hardware address _before_ the interface goes up:
echo "/etc/rc.d/rc.inet1: /sbin/ip link set dev ${1} address ${HWADDR[$i]}" | $LOGGER
/sbin/ip link set dev ${1} address ${HWADDR[$i]}