diff options
author | Robby Workman <rworkman@slackware.com> | 2018-11-26 01:55:19 -0600 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2018-11-26 02:04:37 -0600 |
commit | 405fad2f281900312b2d6e39269a5f44f94ae5d8 (patch) | |
tree | 6f4bb811e5589238bb24ce7fd5221332c26f76a1 | |
parent | 19e8dd5af1cb12f2118f2210e45cd93beaf0a8c9 (diff) | |
download | slacknetsetup-405fad2f281900312b2d6e39269a5f44f94ae5d8.tar.xz |
If modprobe events occurred, sleep for a bit after they finished
This is ugly, but it beats doing the sleep regardless of whether
there's any need for it and causing folks to whine about two
seconds of loss in boot time.
-rw-r--r-- | rc.inet1 | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -59,6 +59,7 @@ for i in "${IFNAME[@]}"; do if /sbin/modprobe -c | grep -v "^#" | grep -w "alias ${i%%:*}" | grep -vw "alias ${i%%:*} off" >/dev/null; then echo "/etc/rc.d/rc.inet1: /sbin/modprobe ${i%%:*}" | $LOGGER /sbin/modprobe ${i%%:*} + _DID_MODPROBE=1 fi fi done @@ -67,8 +68,12 @@ done # set to 0 before that happens, so try to pre-load ipv6 here. if [ ! -e /proc/sys/net/ipv6 ]; then /sbin/modprobe ipv6 + _DID_MODPROBE=1 fi -sleep 1 +# If we did any module loading in the blocks above, sleep for a couple of +# seconds to give time for everything to "take" +[ -n "${_DID_MODPROBE}" ] && sleep 2 +unset _DID_MODPROBE ###################### # LOOPBACK FUNCTIONS # |