diff options
Diffstat (limited to 'bootscripts')
-rw-r--r-- | bootscripts/ChangeLog | 6 | ||||
-rw-r--r-- | bootscripts/lfs/init.d/network | 17 |
2 files changed, 14 insertions, 9 deletions
diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog index 9c8cca44f..8d37e862f 100644 --- a/bootscripts/ChangeLog +++ b/bootscripts/ChangeLog @@ -1,3 +1,7 @@ +2021-06-08 Bruce Dubbs <bdubbs@linuxfromscratch.org> + * When shutting down the network, ignore invalid interfaces + or interfaces that are not UP. + 2021-06-02 Thomas Trepl <thomas@linuxfromscratch.org> * Prevent sendsignals from killing an active mdmon @@ -5,7 +9,7 @@ * Make check_signal more robust. * Use a better methog for killproc to remove a dead pid file. * Clarify what signals killproc accepts. - * Thanks to input an ddiscussion from Scott Andrews. + * Thanks to input and discussion from Scott Andrews. 2021-02-01 Bruce Dubbs <bdubbs@linuxfromscratch.org> * Tweak mountfs to properly exit when an error is found. 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 |