mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +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() {
|
print_json_data() {
|
||||||
local FIRST="$1"
|
local FIRST="$1"
|
||||||
[ -z "$FIRST" ] && (echo "incorrect call to print_json_data $*">&2; exit 1)
|
local VALUE="U"
|
||||||
shift 1
|
shift 1
|
||||||
|
test -z "$FIRST" && echo "missing data for 'print_json_data "" $*'">&2
|
||||||
for KEY in "$@"; do
|
for KEY in "$@"; do
|
||||||
VALUE=$(echo "$FIRST" | jq -cr ".$KEY")
|
if [ -n "$FIRST" ]; then
|
||||||
|
VALUE=$(echo "$FIRST" | jq -cr ".$KEY")
|
||||||
|
fi
|
||||||
echo "$KEY.value $VALUE"
|
echo "$KEY.value $VALUE"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue