Fixes by adding a 3 seconds wait for ping
#!/bin/sh
-ping -W 1 -w 1 -q -s 8 1.1.1.1 &> /dev/null
-status=$?
-if [ $status = 0 ]; then
- exit 0
-fi
-printf "Pinging 1.1.1.1 resulted in error status code $status"
+out="$(ping -W 3 -c 1 -q -s 8 1.1.1.1)"
+[ $? != 0 ] || exit 0
+printf "$out"
exit 1
\ No newline at end of file
