Function to remove search engine

This commit is contained in:
Bob Mottram 2016-07-04 13:01:59 +01:00
parent 6c59300271
commit 06ec000f58
2 changed files with 22 additions and 0 deletions

View File

@ -47,6 +47,7 @@ function remove_irc_server {
iptables -D INPUT -p tcp --dport 1024:65535 --sport $IRC_PORT -j ACCEPT
function_check save_firewall_settings
save_firewall_settings
function_check remove_onion_service
remove_onion_service irc ${IRC_ONION_PORT}
sed -i '/install_irc_server/d' $COMPLETION_FILE
sed -i '/IRC /d' $COMPLETION_FILE

View File

@ -36,6 +36,27 @@ SEARCH_ENGINE_ONION_HOSTNAME=
SEARCH_ENGINE_LOGIN_TEXT=$"Search engine login"
SEARCH_ENGINE_PASSWORD=
function remove_search_engine {
if ! grep -Fxq "install_search_engine" $COMPLETION_FILE; then
return
fi
systemctl stop searx
systemctl disable searx
rm /etc/systemd/system/searx.service
function_check remove_onion_service
remove_onion_service searx ${SEARCH_ENGINE_ONION_PORT}
userdel -r searx
nginx_dissite searx
if [ -f /etc/nginx/sites-available/searx ]; then
rm /etc/nginx/sites-available/searx
fi
if [ -d ${SEARCH_ENGINE_PATH}/searx ]; then
rm -rf ${SEARCH_ENGINE_PATH}/searx
fi
sed -i '/install_search_engine/d' $COMPLETION_FILE
sed -i '/Search engine /d' $COMPLETION_FILE
}
function install_search_engine {
# Note: currently socks5 outgoing proxies to other search engines does not work
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then