pull.sh 477 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

dmorley's avatar
dmorley committed
9
$WGET -d --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 19 20 21 22 23
	echo "Pulling in new pod data";
	cd /var/www/podup/db
	php5 pull.php
	touch last.data
	php5 backup.php
	rm /tmp/index.google
root's avatar
root committed
24
fi