First make sure that a battery is present.
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
This commit is contained in:
parent
e194d43baa
commit
eb61134f29
@ -42,6 +42,10 @@ battery_status()
|
|||||||
case $(uname -s) in
|
case $(uname -s) in
|
||||||
"Linux")
|
"Linux")
|
||||||
BATPATH=${BATPATH:-/sys/class/power_supply/BAT0}
|
BATPATH=${BATPATH:-/sys/class/power_supply/BAT0}
|
||||||
|
if [ ! -d $BATPATH ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
STATUS=$BATPATH/status
|
STATUS=$BATPATH/status
|
||||||
[ "$1" = `cat $STATUS` ] || [ "$1" = "" ] || return 0
|
[ "$1" = `cat $STATUS` ] || [ "$1" = "" ] || return 0
|
||||||
if [ -f "$BATPATH/energy_full" ]; then
|
if [ -f "$BATPATH/energy_full" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user