pull.sh 683 Bytes
Newer Older
dmorley's avatar
dmorley committed
1 2
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
TIME=`date +%k`
David Morley's avatar
David Morley committed
3

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

David Morley's avatar
David Morley committed
11
wget -q --tries=2 --timeout=15 http://www.google.com -O /tmp/index.google
dmorley's avatar
dmorley committed
12 13
sleep 2

14
if [ ! -s /tmp/index.google ];then
David Morley's avatar
David Morley committed
15 16
  echo "could not update pods as no internet"
  rm /tmp/index.google
dmorley's avatar
dmorley committed
17
exit;
18
else
David Morley's avatar
David Morley committed
19 20 21 22
  cd "$SCRIPT_DIR"
  if [ $TIME = 6 ];then
    echo "Pulling in master versions";
    php pull-masterversions.php
dmorley's avatar
dmorley committed
23 24
    echo "Update CA"
    wget https://curl.haxx.se/ca/cacert.pem -O ../cacert.pem
David Morley's avatar
David Morley committed
25 26 27 28 29 30
  fi
  echo "Pulling in new pod data";
  php pull.php
  touch last.data
  php backup.php
  rm /tmp/index.google
root's avatar
root committed
31
fi