From: Lukas Schauer Date: Mon, 14 Sep 2020 16:19:08 +0000 (+0200) Subject: read boolean values from json X-Git-Tag: v0.7.0~32 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4b91fcf498c011d12ede67c29a774d7509551ea3;p=thirdparty%2Fdehydrated.git read boolean values from json --- diff --git a/dehydrated b/dehydrated index d4e31cd..cc1e115 100755 --- a/dehydrated +++ b/dehydrated @@ -67,6 +67,13 @@ get_json_int_value() { sed -n "${filter}" } +# Get boolean value from json +get_json_bool_value() { + local filter + filter="$(printf 's/.*\[%s\]\s*\([^"]*\)/\\1/p' "$(json_path "${1:-}" "${2:-}")")" + sed -n "${filter}" +} + # JSON.sh JSON-parser # Modified from https://github.com/dominictarr/JSON.sh # Original Copyright (c) 2011 Dominic Tarr