ensure config files exist and has at least one value set

set_ini_value does not work on empty files
This commit is contained in:
Eric Nemchik 2023-02-18 19:08:28 -06:00
parent 53bb2e284f
commit d60847483d

View File

@ -42,9 +42,9 @@ function set_ini_value() {
-e '$a'"${name}"'='"${value}" "${3}" -e '$a'"${name}"'='"${value}" "${3}"
} }
# ensure config files exist # ensure config files exist and has at least one value set (set_ini_value does not work on empty files)
touch /config/etc/letsencrypt/cli.ini touch /config/etc/letsencrypt/cli.ini
set_ini_value "agree-tos" "true" /config/etc/letsencrypt/cli.ini grep -qxF 'agree-tos' /config/etc/letsencrypt/cli.ini || echo 'agree-tos=true' >> /config/etc/letsencrypt/cli.ini
# copy dns default configs # copy dns default configs
cp -n /defaults/dns-conf/* /config/dns-conf/ cp -n /defaults/dns-conf/* /config/dns-conf/