summarylogtreecommitdiffstats
path: root/bing-wallpaper-autostart.sh
blob: 0aadbc2a6fb70b74ce12a4845385e71cab90120a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

# 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

	if curl --connect-timeout 2 -s www.baidu.com > /dev/null ; then
		break
	fi

	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