fix: ability to use default cache in scripts (#274)

This commit is contained in:
Amir Zarrinkafsh
2025-08-17 06:05:58 +10:00
committed by GitHub
parent 098c1e9c54
commit 170c0905e4
6 changed files with 7 additions and 13 deletions

View File

@@ -14,8 +14,6 @@ if ! command -v jq >/dev/null; then
exit 1
fi
cachenamedefault="disabled"
while read -r line; do
ip=$(jq ".ips[\"${line}\"]" config.json)
declare "cacheip${line}"="${ip}"
@@ -50,7 +48,7 @@ while read -r entry; do
key=$(jq -r ".cache_domains[${entry}].name" ${path})
cachename="cachename${key}"
if [ -z "${!cachename}" ]; then
cachename=${cachenamedefault}
cachename="cachenamedefault"
fi
if [[ ${cachename} == "disabled" ]]; then
continue