Retrieve onion hostname for search engine

This commit is contained in:
Bob Mottram 2016-03-04 18:18:23 +00:00
parent cdf3e2d6ce
commit 0e06d3b105
1 changed files with 4 additions and 1 deletions

View File

@ -9174,7 +9174,10 @@ function install_search_engine {
if [ -f ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml ]; 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}') 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|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 if [ -f /var/lib/tor/hidden_service_searx/hostname ]; then
SEARCH_ENGINE_ONION_HOSTNAME=$(echo /var/lib/tor/hidden_service_searx/hostname)
sed -i "s|base_url.*|base_url : \"http://${SEARCH_ENGINE_ONION_HOSTNAME}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
fi
fi fi
fi fi