mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-13 19:28:28 +00:00
Source cfg in printconfig if readable
This commit is contained in:
parent
8f7ed3cd05
commit
6ba117dc9d
@ -2975,13 +2975,15 @@ doPrintConfig(){
|
||||
vals["$v"]="${!v}"
|
||||
done
|
||||
for cfgfile in "$configfile" "${HOME}/${arkstUserCfgFile}" "${arkstGlobalCfgFile}"; do
|
||||
while read v; do
|
||||
val="$(source "$cfgfile"; echo "${!v}")"
|
||||
if [[ "$val" = "${vals[$v]}" && -z "${vars[$v]}" ]]; then
|
||||
vars["$v"]="$cfgfile"
|
||||
echo "${cfgfile} => ${v}"
|
||||
fi
|
||||
done < <(sed -n 's/^[[:space:]]*\([A-Za-z_][A-Za-z0-9_]*\)=.*/\1/p' <"$cfgfile")
|
||||
if [ -r "$cfgfile" ]; then
|
||||
while read v; do
|
||||
val="$(source "$cfgfile"; echo "${!v}")"
|
||||
if [[ "$val" = "${vals[$v]}" && -z "${vars[$v]}" ]]; then
|
||||
vars["$v"]="$cfgfile"
|
||||
echo "${cfgfile} => ${v}"
|
||||
fi
|
||||
done < <(sed -n 's/^[[:space:]]*\([A-Za-z_][A-Za-z0-9_]*\)=.*/\1/p' <"$cfgfile")
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user