[fix] Docker: without -f parameter, settings.yml is not replaced by the new version (#1668)

Before this commit, the existing settings.yml were always replaced.
This commit is contained in:
Alexandre Flament 2019-08-03 13:53:14 +02:00 committed by GitHub
parent 333e54943d
commit 91a59ff350
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,7 +71,7 @@ EOF
} }
update_conf() { update_conf() {
FORCE_CONF_UPDATE="$1" FORCE_CONF_UPDATE=$1
CONF="$2" CONF="$2"
NEW_CONF="${2}.new" NEW_CONF="${2}.new"
OLD_CONF="${2}.old" OLD_CONF="${2}.old"
@ -81,7 +81,7 @@ update_conf() {
if [ -f "${CONF}" ]; then if [ -f "${CONF}" ]; then
if [ "${REF_CONF}" -nt "${CONF}" ]; then if [ "${REF_CONF}" -nt "${CONF}" ]; then
# There is a new version # There is a new version
if [ $FORCE_CONF_UPDATE ]; then if [ $FORCE_CONF_UPDATE -ne 0 ]; then
# Replace the current configuration # Replace the current configuration
printf '⚠️ Automaticaly update %s to the new version\n' "${CONF}" printf '⚠️ Automaticaly update %s to the new version\n' "${CONF}"
if [ ! -f "${OLD_CONF}" ]; then if [ ! -f "${OLD_CONF}" ]; then
@ -107,7 +107,7 @@ update_conf() {
} }
# make sure there are uwsgi settings # make sure there are uwsgi settings
update_conf "${FORCE_CONF_UPDATE}" "${UWSGI_SETTINGS_PATH}" "/usr/local/searx/dockerfiles/uwsgi.ini" "patch_uwsgi_settings" update_conf ${FORCE_CONF_UPDATE} "${UWSGI_SETTINGS_PATH}" "/usr/local/searx/dockerfiles/uwsgi.ini" "patch_uwsgi_settings"
# make sure there are searx settings # make sure there are searx settings
update_conf "${FORCE_CONF_UPDATE}" "${SEARX_SETTINGS_PATH}" "/usr/local/searx/searx/settings.yml" "patch_searx_settings" update_conf "${FORCE_CONF_UPDATE}" "${SEARX_SETTINGS_PATH}" "/usr/local/searx/searx/settings.yml" "patch_searx_settings"