From: Ralph Ronnquist Date: Sat, 26 Feb 2022 00:27:09 +0000 (+1100) Subject: fixup of networking X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=8ec1d366c5f269aae495a6f643e4854ac3c147f5;p=rrq%2Fsubhost.git fixup of networking --- diff --git a/startup b/startup index c279cd5..1a71b92 100755 --- 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