Browse Source

apt-compat.cron.daily: Correctly handle undetermined power status

If on_ac_power exits with 255 the script would fail at this point
because set -e was set, but it should continue, as 255 means the
power status could not be determined.

LP: #1742378
tags/devuan/2.0.1+devuan1
Julian Andres Klode 2 years ago
parent
commit
ca2fcc639c
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      debian/apt.apt-compat.cron.daily

+ 3
- 3
debian/apt.apt-compat.cron.daily View File

@@ -19,9 +19,9 @@ check_power()
# 255 (false) Power status could not be determined
# Desktop systems always return 255 it seems
if which on_ac_power >/dev/null 2>&1; then
on_ac_power
POWER=$?
if [ $POWER -eq 1 ]; then
if on_ac_power; then
:
elif [ $? -eq 1 ]; then
return 1
fi
fi


Loading…
Cancel
Save