Ticket #1124: ds-backup080109.sh.patch
File ds-backup080109.sh.patch, 1.3 KB (added by hamiltonchua, 14 years ago) |
---|
-
ds-backup.sh
old new 26 26 function skip_noschoolnet { 27 27 28 28 # no DNS, no XS 29 #grep -c '^nameserver ' /etc/resolv.conf 1>&/dev/null || exit29 grep -c '^nameserver ' /etc/resolv.conf 1>&/dev/null || exit 30 30 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 33 32 34 if [ -e ~/.sugar/ soas/backup_url ]33 if [ -e ~/.sugar/default/identifiers/backup_url ] 35 34 then 36 BACKUP_URL=`cat ~/.sugar/ soas/backup_url`35 BACKUP_URL=`cat ~/.sugar/default/identifiers/backup_url` 37 36 else 38 37 BACKUP_URL='schoolserver' 39 38 fi 40 echo "PINGING BACKUP_URL" 39 40 # can't resolve & ping? outta here 41 41 42 ping -c1 $BACKUP_URL 1>&/dev/null || exit 42 43 43 44 # TODO: if we are on a mesh, count the hops to … … 116 117 cd ~ 117 118 118 119 ## These checks are ordered cheapest first 119 echo "CHECKING IFRECENT ";120 120 skip_ifrecent; 121 echo "CHECKING LOWBAT "; 122 skip_onlowbatt; 123 echo "CHECKING SCHOOL NET "; 121 ## SoaS : do not check battery when we are on SoaS 122 if [ ! -e ~/.sugar/default/identifiers/backup_url ] 123 then 124 skip_onlowbatt; 125 fi 124 126 skip_noschoolnet; 125 echo "DONE WITH CHECKS ";126 127 127 128 ### Ok, we are going to attempt a backup 128 129