2
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

sshd_log: cleanup autoconf

* always return 0
* add details on autoconf failure
This commit is contained in:
Thomas Riccardi 2016-11-12 15:02:26 +01:00
parent c04acf95ac
commit ff68f64155

View file

@ -47,21 +47,18 @@ JOURNALCTL_ARG=${journalctlarg:-_COMM=sshd}
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ "$LOG" = "journald" ]; then if [ "$LOG" = "journald" ]; then
if journalctl --no-pager --quiet --lines=1 "$JOURNALCTL_ARG" | read -r DUMMY; then if journalctl --no-pager --quiet --lines=1 "$JOURNALCTL_ARG" | read -r DUMMY; then
echo yes echo "yes"
exit 0
else else
echo no echo "no (journald empty log for '$JOURNALCTL_ARG' not found)"
exit 1
fi fi
else else
if [ -r "$LOG" ]; then if [ -r "$LOG" ]; then
echo yes echo "yes"
exit 0
else else
echo no echo "no (logfile '$LOG' not readable)"
exit 1
fi fi
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then