1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +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,16 +50,22 @@ EOM
;; ;;
autoconf) 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 if [ -n "$updates" ]; then
echo "updates.value $(echo "$updates" | wc -l)" echo "updates.value $(echo "$updates" | wc -l)"
echo "updates.extinfo $(echo "$updates" | paste -s -d,)" echo "updates.extinfo $(echo "$updates" | paste -s -d,)"
else else
echo updates.value 0 echo updates.value 0
fi
echo "updates.value U" && exit
fi fi
;; ;;
esac esac