Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/bash
- /usr/bin/date > /root/booting.log
- # Wait for internt online
- ((count = 600)) # Maximum number to try.
- while [[ $count -ne 0 ]] ; do
- ping -c 1 8.8.8.8 > /dev/null 2>&1 # Try once.
- rc=$?
- if [[ $rc -eq 0 ]] ; then
- ((count = 1)) # If okay, flag to exit loop.
- else
- sleep 1
- echo "Wait count : $count"
- fi
- ((count = count - 1)) # So we don't go forever.
- done
- if [[ $rc -eq 0 ]] ; then # Make final determination.
- #DO SOMETIING
- else
- echo "Timeout for internet online wait" >> /root/booting.log
- fi
Add Comment
Please, Sign In to add comment