Ensure that searx settings are preserved during upgrades

This commit is contained in:
Bob Mottram 2017-04-16 16:59:36 +01:00
parent 079e370def
commit 20f33b5b82
1 changed files with 6 additions and 0 deletions

View File

@ -723,16 +723,22 @@ function create_searx_config {
}
function upgrade_searx {
settings_file=${SEARX_PATH}/searx/searx/settings.yml
background_image=/etc/searx/searx/static/themes/courgette/img/bg-body-index.jpg
if [ -f ${background_image} ]; then
cp ${background_image} ${background_image}.prev
fi
cp ${settings_file} ${settings_file}.prev
set_repo_commit $SEARX_PATH/searx "searx commit" "$SEARX_COMMIT" $SEARX_REPO
if [ -f ${background_image}.prev ]; then
cp ${background_image}.prev ${background_image}
chown -R searx:searx ${SEARX_PATH}/searx
fi
if [ -f ${settings_file}.prev ]; then
cp ${settings_file}.prev ${settings_file}
chown -R searx:searx ${SEARX_PATH}/searx
fi
}
function backup_local_searx {