|
|
@ -616,44 +616,9 @@ EOF |
|
|
|
|
|
|
|
|
|
|
|
_get_custom_rules() { |
|
|
|
local cfg="$1" custom_rules type elt value first |
|
|
|
custom_rules=$(e "$cfg" | cfg-get-value apache-custom-rules 2>/dev/null) || true |
|
|
|
if [ -z "$custom_rules" -o "$custom_rules" == "None" ]; then |
|
|
|
return 0 |
|
|
|
fi |
|
|
|
type=$(echo "$custom_rules" | shyaml get-type) |
|
|
|
value= |
|
|
|
case "$type" in |
|
|
|
"sequence") |
|
|
|
first=1 |
|
|
|
while read-0 elt; do |
|
|
|
elt="$(echo "$elt" | yaml_get_interpret)" || return 1 |
|
|
|
[ "$elt" ] || continue |
|
|
|
if [ "$first" ]; then |
|
|
|
first= |
|
|
|
else |
|
|
|
value+=$'\n' |
|
|
|
fi |
|
|
|
first= |
|
|
|
value+="$elt" |
|
|
|
done < <(echo "$custom_rules" | shyaml -y get-values-0) |
|
|
|
;; |
|
|
|
"struct") |
|
|
|
while read-0 _key val; do |
|
|
|
value+=$'\n'"$(echo "$val" | yaml_get_interpret)" || return 1 |
|
|
|
done < <(echo "$custom_rules" | shyaml -y key-values-0) |
|
|
|
;; |
|
|
|
"str") |
|
|
|
value+=$(echo "$custom_rules") |
|
|
|
;; |
|
|
|
"NoneType") |
|
|
|
value="" |
|
|
|
;; |
|
|
|
*) |
|
|
|
value+=$(echo "$custom_rules") |
|
|
|
;; |
|
|
|
esac |
|
|
|
printf "%s" "$value" |
|
|
|
local cfg="$1" custom_rules |
|
|
|
custom_rules=$(e "$cfg" | shyaml -y -q get-value apache-custom-rules 2>/dev/null) || true |
|
|
|
e "$custom_rules" | yaml_get_values |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|