You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
546 B
Bash
22 lines
546 B
Bash
#!/bin/sh
|
|
BASE_PATH="$.SystemConfig.Services.System.Baptization"
|
|
JSON_CONFIG="$(chunk -F - extract_config | gunzip | xml2json -n | jsonfilter -e $BASE_PATH)"
|
|
|
|
print_baptization_key() {
|
|
local key=$1
|
|
echo "$key"=$(jsonfilter -s "$JSON_CONFIG" -e "\$.$key")
|
|
}
|
|
|
|
# If a specific key is given, print just that one
|
|
if [ "$1" = "-k" ]; then
|
|
print_baptization_key $2
|
|
exit 0
|
|
fi
|
|
|
|
# Otherwise, print all
|
|
eval $(jsonfilter -s "$JSON_CONFIG" -e BAPTIZATION_KEYS="\$")
|
|
for key in $BAPTIZATION_KEYS; do
|
|
print_baptization_key $key
|
|
done
|
|
exit 0
|