mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
[nextcloud_] Softer failure on missing data
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This commit is contained in:
parent
f47fddf326
commit
7dcbc91c7e
1 changed files with 5 additions and 2 deletions
|
@ -70,10 +70,13 @@ PASSWORD="${password:-}"
|
|||
|
||||
print_json_data() {
|
||||
local FIRST="$1"
|
||||
[ -z "$FIRST" ] && (echo "incorrect call to print_json_data $*">&2; exit 1)
|
||||
local VALUE="U"
|
||||
shift 1
|
||||
test -z "$FIRST" && echo "missing data for 'print_json_data "" $*'">&2
|
||||
for KEY in "$@"; do
|
||||
if [ -n "$FIRST" ]; then
|
||||
VALUE=$(echo "$FIRST" | jq -cr ".$KEY")
|
||||
fi
|
||||
echo "$KEY.value $VALUE"
|
||||
done
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue