Ticket #1124: ds-backup080109.sh.patch

File ds-backup080109.sh.patch, 1.3 KB (added by hamiltonchua, 12 years ago)
  • ds-backup.sh

    old new  
    2626function skip_noschoolnet {
    2727
    2828    # no DNS, no XS
    29     # grep -c '^nameserver ' /etc/resolv.conf 1>&/dev/null || exit
     29    grep -c '^nameserver ' /etc/resolv.conf 1>&/dev/null || exit
    3030
    31     # can't resolve & ping? outta here
    32     # verify if we are inside an soas
     31    # verify if we got the backup_url from registration
    3332
    34     if [ -e ~/.sugar/soas/backup_url ]
     33    if [ -e ~/.sugar/default/identifiers/backup_url ]
    3534    then
    36       BACKUP_URL=`cat ~/.sugar/soas/backup_url`
     35      BACKUP_URL=`cat ~/.sugar/default/identifiers/backup_url`
    3736    else
    3837      BACKUP_URL='schoolserver'
    3938    fi
    40     echo "PINGING BACKUP_URL"
     39
     40    # can't resolve & ping? outta here
     41
    4142    ping -c1 $BACKUP_URL 1>&/dev/null || exit
    4243
    4344    # TODO: if we are on a mesh, count the hops to
     
    116117cd ~
    117118
    118119## These checks are ordered cheapest first
    119 echo "CHECKING IFRECENT ";
    120120skip_ifrecent;
    121 echo "CHECKING LOWBAT ";
    122 skip_onlowbatt;
    123 echo "CHECKING SCHOOL NET ";
     121## SoaS : do not check battery when we are on SoaS
     122if [ ! -e ~/.sugar/default/identifiers/backup_url ]
     123then
     124  skip_onlowbatt;
     125fi
    124126skip_noschoolnet;
    125 echo "DONE WITH CHECKS ";
    126127
    127128### Ok, we are going to attempt a backup
    128129