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

root's avatar
root committed
9
$WGET -q --tries=10 --timeout=15 http://www.google.com -O /tmp/index.google &> /dev/null
10 11
if [ ! -s /tmp/index.google ];then
	echo "could not update pods as no internet"
root's avatar
root committed
12
rm /tmp/index.google
13
else
root's avatar
root committed
14
echo "Pulling in new pod data";
15
cd /var/www/podup/db
root's avatar
root committed
16
php5 pull.php
17
touch last.data
dmorley's avatar
br  
dmorley committed
18
php5 backup.php
root's avatar
root committed
19 20
rm /tmp/index.google
fi