Support sysfs.

Fixes #214
This commit is contained in:
Michal Gorny 2010-03-27 08:53:04 +00:00 committed by Roy Marples
parent 4d86d34635
commit 20b4076b12

View File

@ -9,6 +9,10 @@ if [ -f /proc/acpi/ac_adapter/AC*/state ]; then
"state:"*"off-line") return 128;;
esac
done
elif [ -f /sys/class/power_supply/AC*/online ]; then
cat /sys/class/power_supply/AC*/online | while read line; do
[ "${line}" = 0 ] && return 128
done
elif [ -f /proc/pmu/info ]; then
cat /proc/pmu/info | while read line; do
case "$line" in