diff --git a/src/freedombone-app-searx b/src/freedombone-app-searx index 68bc1cf73e1b6d9a04f818b658049e41dda52e7c..6980be4a84ba1babe0c8e59265428faf43679a3e 100755 --- a/src/freedombone-app-searx +++ b/src/freedombone-app-searx @@ -58,11 +58,19 @@ function logging_off_searx { function searx_set_default_background { if [ -f "$rootdir/root/${PROJECT_NAME}/img/backgrounds/searx.jpg" ]; then cp "$rootdir/root/${PROJECT_NAME}/img/backgrounds/searx.jpg" "$rootdir/etc/searx/searx/static/themes/courgette/img/bg-body-index.jpg" - chown -R searx:searx "$rootdir${SEARX_PATH}/searx" + if [ "$rootdir" ]; then + chroot "$rootdir" chown -R searx:searx "${SEARX_PATH}/searx" + else + chown -R searx:searx "$rootdir${SEARX_PATH}/searx" + fi else if [ -f "$rootdir/home/$MY_USERNAME/${PROJECT_NAME}/img/backgrounds/searx.jpg" ]; then cp "$rootdir/home/$MY_USERNAME/${PROJECT_NAME}/img/backgrounds/searx.jpg" "$rootdir/etc/searx/searx/static/themes/courgette/img/bg-body-index.jpg" - chown -R searx:searx "$rootdir${SEARX_PATH}/searx" + if [ "$rootdir" ]; then + chroot "$rootdir" chown -R searx:searx "${SEARX_PATH}/searx" + else + chown -R searx:searx "$rootdir${SEARX_PATH}/searx" + fi fi fi diff --git a/src/freedombone-utils-search b/src/freedombone-utils-search old mode 100644 new mode 100755 index 93147941e2554916729c4871108a355a6c5ec11c..9d652893feca91249b0d20886f7d5341d382f3aa --- a/src/freedombone-utils-search +++ b/src/freedombone-utils-search @@ -34,11 +34,19 @@ SEARX_PORT=8888 function searx_set_default_background { if [ -f "$rootdir/root/${PROJECT_NAME}/img/backgrounds/searx.jpg" ]; then cp "$rootdir/root/${PROJECT_NAME}/img/backgrounds/searx.jpg" "$rootdir/etc/searx/searx/static/themes/courgette/img/bg-body-index.jpg" - chown -R searx:searx "$rootdir${SEARX_PATH}/searx" + if [ "$rootdir" ]; then + chroot "$rootdir" chown -R searx:searx "${SEARX_PATH}/searx" + else + chown -R searx:searx "$rootdir${SEARX_PATH}/searx" + fi else if [ -f "$rootdir/home/$MY_USERNAME/${PROJECT_NAME}/img/backgrounds/searx.jpg" ]; then cp "$rootdir/home/$MY_USERNAME/${PROJECT_NAME}/img/backgrounds/searx.jpg" "$rootdir/etc/searx/searx/static/themes/courgette/img/bg-body-index.jpg" - chown -R searx:searx "$rootdir${SEARX_PATH}/searx" + if [ "$rootdir" ]; then + chroot "$rootdir" chown -R searx:searx "${SEARX_PATH}/searx" + else + chown -R searx:searx "$rootdir${SEARX_PATH}/searx" + fi fi fi