Created
January 2, 2016 09:48
-
-
Save frknozr/063e0e766788b260507f to your computer and use it in GitHub Desktop.
check internet connection nad download file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "shameless downloader" | |
url="https://lh3.googleusercontent.com/hcDn1bB2EOLeugnZ6iSNGx0oJK53GQF13Kxv3griig0=m22" | |
while true; do | |
wget -q --spider $url | |
if [ $? -eq 0 ] | |
then | |
date | |
echo "Online" | |
echo "Downloading" | |
wget $url | |
echo "Downloaded" | |
exit | |
else | |
echo "Offline" | |
fi | |
sleep 10m | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment