1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Plugin pacman_pending_updates: fix and clarify conditionals

The "checkupdates" compound statement (" ... || ... && ...") did not
work due to the equal precendence of both operators (introduced in
6cb5c9e104).

Closes: #1004

Thanks to Ken-ichi Mito for reporting this issue.
This commit is contained in:
Lars Kruse 2019-07-31 03:33:13 +02:00
parent d6d5fa80be
commit 72f0546b04

View file

@ -50,17 +50,23 @@ EOM
;;
autoconf)
hash checkupdates &> /dev/null && echo yes || echo "no (checkupdates not found)"
if hash checkupdates >/dev/null 2>&1; then
echo yes
else
echo "no (checkupdates not found)"
fi
;;
*)
updates="$(checkupdates)" || echo "updates.value U" && exit
if updates="$(checkupdates)"; then
if [ -n "$updates" ]; then
echo "updates.value $(echo "$updates" | wc -l)"
echo "updates.extinfo $(echo "$updates" | paste -s -d,)"
else
echo updates.value 0
fi
echo "updates.value U" && exit
fi
;;
esac