pull.sh 488 Bytes
Newer Older
1
WGET="/usr/bin/wget"
root's avatar
root committed
2
if [ -s /tmp/index.google ];then
dmorley's avatar
dmorley committed
3
        echo "already running die"
root's avatar
root committed
4 5
exit;
else
dmorley's avatar
dmorley committed
6
	echo "Checking for internet";
root's avatar
root committed
7
fi
8

9
$WGET -q --tries=10 --timeout=15 http://www.google.com -O /tmp/index.google
dmorley's avatar
dmorley committed
10 11 12
# &> /dev/null
sleep 2

13 14
if [ ! -s /tmp/index.google ];then
	echo "could not update pods as no internet"
dmorley's avatar
dmorley committed
15 16
	rm /tmp/index.google
exit;
17
else
dmorley's avatar
dmorley committed
18
	echo "Pulling in new pod data";
dmorley's avatar
dmorley committed
19
	cd /var/www/poduptime/db
dmorley's avatar
cleanup  
dmorley committed
20
	php pull.php debug=1
21
 	touch last.data
dmorley's avatar
cleanup  
dmorley committed
22
	php backup.php
dmorley's avatar
dmorley committed
23
	rm /tmp/index.google
root's avatar
root committed
24
fi