Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_fixcpp/acme/bin/Battery – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
 
3
if(! test -f /mnt/apm/battery){
4
	echo no apm >[1=2]
5
	exit 'no apm'
6
}
7
 
8
cd /mnt/acme/new
9
echo name /dev/apm >ctl
10
echo dump Battery >ctl
11
 
12
awkscript='
13
NR==1 {
14
	if($3 != -1)
15
		printf("%d%% %d:%02d %s", $2, $3/3600, ($3/60)%60, $1);
16
	else
17
		printf("%d%% %s", $2, $1);
18
}
19
'
20
 
21
fn chk {
22
	what=`{awk $awkscript /mnt/apm/battery}
23
	echo cleartag >ctl || exit die
24
	echo clean >ctl || exit die
25
	echo ' '^$"what >tag || exit die
26
}
27
 
28
chk
29
while(sleep 60)
30
	chk