summaryrefslogtreecommitdiff
path: root/debian/apt.apt-compat.cron.daily
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2018-01-10 08:30:25 +0100
committerJulian Andres Klode <jak@debian.org>2018-01-10 08:33:41 +0100
commitca2fcc639c7363a04998f650b96573d806b32dd2 (patch)
treed426931ca5aaa951169c4182aedce7f2d9c9888e /debian/apt.apt-compat.cron.daily
parentdf2d614900476920671779f27fcc4143d3c1b5b7 (diff)
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
Diffstat (limited to 'debian/apt.apt-compat.cron.daily')
-rw-r--r--debian/apt.apt-compat.cron.daily6
1 files changed, 3 insertions, 3 deletions
diff --git a/debian/apt.apt-compat.cron.daily b/debian/apt.apt-compat.cron.daily
index 095a44c4a..b0b553768 100644
--- a/debian/apt.apt-compat.cron.daily
+++ b/debian/apt.apt-compat.cron.daily
@@ -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