diff options
Diffstat (limited to 'bootscripts/lfs/init.d/network')
-rw-r--r-- | bootscripts/lfs/init.d/network | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/bootscripts/lfs/init.d/network b/bootscripts/lfs/init.d/network index 17afa0983..710cfcfd4 100644 --- a/bootscripts/lfs/init.d/network +++ b/bootscripts/lfs/init.d/network @@ -35,10 +35,7 @@ case "${1}" in interface=${file##*/ifconfig.} # Skip if $file is * (because nothing was found) - if [ "${interface}" = "*" ] - then - continue - fi + if [ "${interface}" = "*" ]; then continue; fi /sbin/ifup ${interface} done @@ -61,10 +58,14 @@ case "${1}" in interface=${file##*/ifconfig.} # Skip if $file is * (because nothing was found) - if [ "${interface}" = "*" ] - then - continue - fi + if [ "${interface}" = "*" ]; then continue; fi + + # See if interface exists + if [ ! -e /sys/class/net/$interface ]; then continue; fi + + # Is interface UP? + ip link show $interface 2>/dev/null | grep -q "state UP" + if [ $? -ne 0 ]; then continue; fi /sbin/ifdown ${interface} done |