File: linuxpmu.sh

package info (click to toggle)
netmrg 0.20-7
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,896 kB
  • ctags: 2,012
  • sloc: php: 9,401; sh: 4,791; cpp: 2,898; perl: 621; ansic: 381; makefile: 337; xml: 92; sql: 71; sed: 16
file content (13 lines) | stat: -rwxr-xr-x 320 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

# Author: Uwe Steinmann <uwe@steinmann.cx>

# usage linuxpmu.sh <battery number> <command>
#   battery number can be 0 or 1
#   command can be 'charge', 'max_charge', 'current', 'voltage'

if [ -f /proc/pmu/battery_$1 ]; then
	cat /proc/pmu/battery_$1 | grep "^$2 *:" | awk -F: '{print $2}'
else
	echo "U"
fi