diff options
author | Weitian Leung | 2015-12-02 20:17:21 +0800 |
---|---|---|
committer | Weitian Leung | 2015-12-02 20:17:21 +0800 |
commit | fe9cfae0f6da2e1d899f1a29e540717c24709bf0 (patch) | |
tree | 562124ef9538043ad9bfe31830e71148019a68ff /bing-wallpaper-autostart.sh | |
parent | de09ae9d1b9216204d7e9da8ddc738228af1ba89 (diff) | |
download | aur-fe9cfae0f6da2e1d899f1a29e540717c24709bf0.tar.gz |
network connection availability check limited to 3 times
Diffstat (limited to 'bing-wallpaper-autostart.sh')
-rwxr-xr-x | bing-wallpaper-autostart.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bing-wallpaper-autostart.sh b/bing-wallpaper-autostart.sh index 1b40b2693f8b..0aadbc2a6fb7 100755 --- a/bing-wallpaper-autostart.sh +++ b/bing-wallpaper-autostart.sh @@ -1,6 +1,8 @@ #!/bin/sh -while true; do +# try 3 times only +i=1 +while [ $i -le 3 ]; do if curl --connect-timeout 2 -s www.google.com > /dev/null ; then break fi @@ -9,8 +11,12 @@ while true; do break fi - sleep 5 + seconds=$((5 * $i)) + sleep $seconds + + let i=i+1 done +# starting the work even without network availability cd /usr/lib/bing-wallpaper ./bing_wallpaper.sh |