~popey/+junk/phablet-flash-wrapper

« back to all changes in this revision

Viewing changes to powerstat.sh

  • Committer: Alan Pope
  • Date: 2013-07-30 09:34:06 UTC
  • Revision ID: alan.pope@canonical.com-20130730093406-t7ah2cxedokwnsi8
add script to automate testing

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
# Run this to log battery usage
4
4
# via cron:-
5
 
# * * * * * /home/phablet/powerstat.sh >> /home/phablet/battery.log
 
5
# * * * * * /home/phablet/powerstat.sh >> /home/phablet/battery.csv
6
6
 
7
7
P="/sys/class/power_supply/battery"
8
 
D=$(date +%Y%m%d)
9
 
T=$(date +%H%M%S)
10
 
 
 
8
D=$(date -u +%d/%m/%Y)
 
9
T=$(date -u +%H:%M:%S)
 
10
DEV=$(getprop ro.cm.device)
 
11
 
 
12
if [ "$DEV" == "grouper" ]; then
 
13
echo $D, \
 
14
     $T, \
 
15
     $(cat $P/status), \
 
16
     $(cat $P/health), \
 
17
     $(cat $P/capacity), \
 
18
     $(cat $P/temp), \
 
19
     $(cat $P/charge_full_design), \
 
20
     $(cat $P/charge_now), \
 
21
     $(cat $P/voltage_now)
 
22
fi
 
23
 
 
24
if [ "$DEV" == "mako" ]; then
11
25
echo $D, \
12
26
     $T, \
13
27
     $(cat $P/status), \
17
31
     $(cat $P/voltage_max_design), \
18
32
     $(cat $P/voltage_min_design), \
19
33
     $(cat $P/voltage_now)
 
34
fi