Cleanup, README
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
#!/bin/bash
|
||||
echo "$(date): Connect to Internet..."
|
||||
#systemctl stop gammu-smsd
|
||||
pon rnet
|
||||
sleep 20
|
||||
sleep 5
|
||||
|
||||
x=0
|
||||
# Wait until connection is established
|
||||
if ping -c 1 8.8.8.8 &>/dev/null ; then
|
||||
echo "Already Connected - $(date)"
|
||||
else
|
||||
echo "Not Connected - $( date )"
|
||||
echo "connecting wait ..."
|
||||
sleep 20
|
||||
fi
|
||||
|
||||
# Wir wollen sicher sein, dass die Verbindung steht...
|
||||
ping -c 1 -w 30 8.8.8.8 >/dev/null
|
||||
sleep 3
|
||||
while ! ping -c 1 8.8.8.8 &>/dev/null ; do
|
||||
echo "$(date): wait for internet connection to come up"
|
||||
sleep 5
|
||||
if [ $x -gt 10 ]; then
|
||||
# Time out here
|
||||
echo "$(date): Could not connect to internet (timeout)..."
|
||||
exit 1
|
||||
fi
|
||||
x=$((x+1))
|
||||
done
|
||||
echo "$(date): Connected to Internet..."
|
||||
|
||||
Reference in New Issue
Block a user