muninlite: do not crash if empty line is received (#8)

Trivial fix for the following error:

  root@naru:~# echo "" | ./muninlite
  ./muninlite: line 696: do_: not found
  root@naru:~#
This commit is contained in:
Kim B. Heino 2020-10-07 20:08:49 +03:00 committed by GitHub
parent e6f5722a04
commit ebd0cca326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ do
arg1=$(echo "$arg1" | xargs)
if ! echo "$FUNCTIONS" | grep -qwF "$arg0"; then
echo "# Unknown command. Try $(echo "$FUNCTIONS" | sed -e 's/\( [[:alpha:]]\{1,\}\)/,\1/g' -e 's/,\( [[:alpha:]]\{1,\}\)$/ or\1/')"
else
elif [ -n "$arg0" ]; then
"do_$arg0" "$arg1"
fi
done