fixup of networking
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Sat, 26 Feb 2022 00:27:09 +0000 (11:27 +1100)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Sat, 26 Feb 2022 00:27:09 +0000 (11:27 +1100)
startup

diff --git a/startup b/startup
index c279cd5312fe89a3a8de71b2eb6a2b29adaffa4e..1a71b92b2eeef97124d60cf3a1f4f2e19e0058c5 100755 (executable)
--- a/startup
+++ b/startup
@@ -17,19 +17,22 @@ NOW=$(date +"%Y%m%d-%H%M%S")
        mkdir -p /run/lock /run/user
     fi
     
-    # Restart auto interfaces
-    for IF in $(grep "^auto" /etc/network/interfaces) ; do
-       [ "$IF" = auto ] && continue
-       ifdown $IF
-       ifup $IF
-    done
-
-    # Restart services
-    SERVICES=( )
-    for S in ${SERVICES[@]} ; do
-       service $S restart
-    done
+    {
+       # Restart auto interfaces
+       for IF in $(grep "^auto" /etc/network/interfaces) ; do
+           [ -e "/sys/class/net/$IF" ] || continue
+           ifdown $IF
+           ifup $IF
+       done
+    
+       # Restart services
+       SERVICES=( )
+       for S in ${SERVICES[@]} ; do
+           service $S restart
+       done
+    } &
+    NETPID=$!
 
-} >& /var/log/startup-$NOW.log
+} |& tee /var/log/startup-$NOW.log
 
 exec /bin/bash