Ensure that key and base url remain unchanged after updates
This commit is contained in:
parent
1cfe374210
commit
cdf3e2d6ce
|
@ -9170,6 +9170,13 @@ function install_search_engine {
|
||||||
|
|
||||||
# update to a new commit if needed
|
# update to a new commit if needed
|
||||||
set_repo_commit $SEARCH_ENGINE_PATH/searx "Search engine commit" "$SEARCH_ENGINE_COMMIT" $SEARCH_ENGINE_REPO
|
set_repo_commit $SEARCH_ENGINE_PATH/searx "Search engine commit" "$SEARCH_ENGINE_COMMIT" $SEARCH_ENGINE_REPO
|
||||||
|
if grep "Search engine key" $COMPLETION_FILE; then
|
||||||
|
if [ -f ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml ]; then
|
||||||
|
SEARCH_ENGINE_SECRET_KEY=$(cat $COMPLETION_FILE | grep "Search engine key" | awk -F ':' '{print $2}')
|
||||||
|
sed -i "s|secret_key.*|secret_key : \"${SEARCH_ENGINE_SECRET_KEY}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
|
||||||
|
sed -i "s|base_url.*|base_url : \"http://${SEARCH_ENGINE_ONION_HOSTNAME}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if grep -Fxq "install_search_engine" $COMPLETION_FILE; then
|
if grep -Fxq "install_search_engine" $COMPLETION_FILE; then
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue