pull.sh 483 Bytes
Newer Older
David Morley's avatar
David Morley committed
1 2
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"

root's avatar
root committed
3
if [ -s /tmp/index.google ];then
dmorley's avatar
dmorley committed
4
        echo "already running die"
root's avatar
root committed
5 6
exit;
else
dmorley's avatar
dmorley committed
7
	echo "Checking for internet";
root's avatar
root committed
8
fi
9

David Morley's avatar
David Morley committed
10
wget -q --tries=2 --timeout=15 http://www.google.com -O /tmp/index.google
dmorley's avatar
dmorley committed
11 12
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";
David Morley's avatar
David Morley committed
19 20
	cd "$SCRIPT_DIR"
	php pull.php
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