5 if [[ "${@/noup}" != "$@" ]]
7 echo "no update attempted"
11 if [ "$state" == "up" ]
13 # there's a chance of loss of battery.log here if device went
14 # down just as we're copying from it. But given we have all
15 # in mercurial that's ok, we can recover.
16 ssh basil.dsg.cs.tcd.ie scp loradtn@tunloradtn:/var/log/battery.log .
17 scp basil.dsg.cs.tcd.ie:battery.log .
18 ./battery-seds.sh battery.log >sedded-battery.log
25 if [[ "${@/today}" != "$@" ]]
27 today=`date --rfc-3339=date`
29 | sed -e 's/2017-01-01/'$today'/' \
30 | sed -e 's/2017-09-30/'$today'/' \
31 | sed -e 's/loradtn.png/loradtn-'$today'.png/' \
32 >daily/loradtn-$today.gpl
33 gnuplot daily/loradtn-$today.gpl
34 mv loradtn-$today.png daily
35 hg add daily/loradtn-$today.*
41 if [ "$others" != "" ]
43 # assume parameter is nicely formed date
44 theday=`echo $others | sed -e 's/ //g'`
46 | sed -e 's/2017-01-01/'$theday'/' \
47 | sed -e 's/2017-09-30/'$theday'/' \
48 | sed -e 's/loradtn.png/loradtn-'$theday'.png/' \
49 >daily/loradtn-$theday.gpl
50 gnuplot daily/loradtn-$theday.gpl
51 mv loradtn-$theday.png daily
52 hg add daily/loradtn-$theday.*
54 # generate new overview