diff --git a/lib.sh b/lib.sh index ed9262d0..1b645e45 100644 --- a/lib.sh +++ b/lib.sh @@ -207,19 +207,27 @@ ip link set "$IFACE" down wait ip link set "$IFACE" up wait -check_command service network-manager restart echo "Checking connection..." -sleep 3 -if ! nslookup github.com +check_command service network-manager restart +sleep 2 +if nslookup github.com +then + echo "Online!" +elif ! nslookup github.com then echo "Trying to restart networking service..." check_command service networking restart -fi -if ! nslookup github.com -then + if nslookup github.com + then + echo "Online!" + fi +else + if ! nslookup github.com + then msg_box "Network NOT OK. You must have a working network connection to run this script If you think that this is a bug, please report it to https://github.com/nextcloud/vm/issues." exit 1 + fi fi }