blob: ee2e5c3dc0757d731d920ee676c3e8eced008b64 [file] [log] [blame]
--- laptop-mode-tools-1.59/usr/sbin/laptop_mode
+++ laptop-mode-tools-1.59/usr/sbin/laptop_mode
@@ -807,7 +807,9 @@ lmt_main_function ()
fi
# $BATT/alarm is the design_capacity_warning of a battery.
- ALARM_LEVEL=$(cat $BATT/alarm)
+ ALARM_LEVEL=0
+ ALARM_FILE=$BATT/alarm
+ if [ -f $ALARM_FILE ]; then ALARM_LEVEL=$(cat $ALARM_FILE); fi
if [ "$ALARM_LEVEL" -ne 0 ] ; then
if [ "$REMAINING" -le "$ALARM_LEVEL" ] ; then
# Restore the state we had before checking this battery, so that