From 40281de73e3e5a57fbac81edae6994c92e8f6e35 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 16 Apr 2017 18:56:49 +0100 Subject: [PATCH] Comments --- src/freedombone-app-searx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/freedombone-app-searx b/src/freedombone-app-searx index 614e7866..a2dacf03 100755 --- a/src/freedombone-app-searx +++ b/src/freedombone-app-searx @@ -61,6 +61,7 @@ function searx_set_default_background { fi fi + # remove the github ribbon icon if [ -f /etc/searx/searx/static/themes/courgette/img/github_ribbon.png ]; then mv /etc/searx/searx/static/themes/courgette/img/github_ribbon.png /etc/searx/searx/static/themes/courgette/img/github_ribbon.png.old fi @@ -729,20 +730,31 @@ 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 + + # save the background image if [ -f ${background_image} ]; then cp ${background_image} ${background_image}.prev fi + + # save the settings cp ${settings_file} ${settings_file}.prev + # do the upgrade set_repo_commit $SEARX_PATH/searx "searx commit" "$SEARX_COMMIT" $SEARX_REPO + + # restore the background image if [ -f ${background_image}.prev ]; then cp ${background_image}.prev ${background_image} chown -R searx:searx ${SEARX_PATH}/searx fi + + # restore the settings if [ -f ${settings_file}.prev ]; then cp ${settings_file}.prev ${settings_file} chown -R searx:searx ${SEARX_PATH}/searx fi + + # remove the github ribbon icon if [ -f /etc/searx/searx/static/themes/courgette/img/github_ribbon.png ]; then mv /etc/searx/searx/static/themes/courgette/img/github_ribbon.png /etc/searx/searx/static/themes/courgette/img/github_ribbon.png.old fi