Onion support in for app removals

This commit is contained in:
Bob Mottram 2016-07-04 08:31:29 +01:00
parent 5281b96330
commit 6c59300271
8 changed files with 21 additions and 0 deletions

View File

@ -53,6 +53,8 @@ function remove_blog {
sed -i "/$FULLBLOG_CODE/d" /usr/bin/dynamicdns
fi
fi
function_check remove_onion_service
remove_onion_service blog ${FULLBLOG_ONION_PORT}
sed -i '/install_blog/d' $COMPLETION_FILE
sed -i '/Blog .*/d' $COMPLETION_FILE
}

View File

@ -60,6 +60,8 @@ function remove_gnu_social {
fi
function_check drop_database
drop_database gnusocial
function_check remove_onion_service
remove_onion_service microblog ${MICROBLOG_ONION_PORT}
sed -i '/install_gnu_social/d' $COMPLETION_FILE
sed -i '/GNU Social /d' $COMPLETION_FILE
}

View File

@ -55,6 +55,7 @@ function remove_gogs {
drop_database gogs
rm /etc/systemd/system/gogs.service
rm -rf $GOPATH/src/github.com/gogits
remove_onion_service gogs ${GIT_ONION_PORT} 9418
sed -i '/install_gogs/d' $COMPLETION_FILE
sed -i '/Gogs /d' $COMPLETION_FILE
}

View File

@ -51,6 +51,8 @@ function remove_hubzilla {
fi
function_check drop_database
drop_database hubzilla
function_check remove_onion_service
remove_onion_service hubzilla ${HUBZILLA_ONION_PORT}
sed -i '/install_hubzilla/d' $COMPLETION_FILE
sed -i '/Hubzilla /d' $COMPLETION_FILE
}

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
remove_onion_service irc ${IRC_ONION_PORT}
sed -i '/install_irc_server/d' $COMPLETION_FILE
sed -i '/IRC /d' $COMPLETION_FILE
sed -i '/configure_firewall_for_irc/d' $COMPLETION_FILE

View File

@ -51,6 +51,8 @@ function remove_mumble {
if [ -f /etc/mumble-server.ini ]; then
rm /etc/mumble-server.ini
fi
function_check remove_onion_service
remove_onion_service voip ${VOIP_PORT}
sed -i '/install_mumble/d' $COMPLETION_FILE
sed -i '/install_voip/d' $COMPLETION_FILE
sed -i '/configure_firewall_for_voip/d' $COMPLETION_FILE

View File

@ -45,6 +45,8 @@ function remove_rss_reader {
return
fi
nginx_dissite $RSS_READER_DOMAIN_NAME
function_check remove_onion_service
remove_onion_service ttrss ${RSS_READER_ONION_PORT} ${RSS_MOBILE_READER_ONION_PORT}
if [ -f /etc/nginx/sites-available/$RSS_READER_DOMAIN_NAME ]; then
rm /etc/nginx/sites-available/$RSS_READER_DOMAIN_NAME
fi

View File

@ -59,6 +59,15 @@ function remove_onion_service {
onion_service_port_to=$2
sed -i "/hidden_service_${onion_service_name}/d" /etc/tor/torrc
sed -i "/127.0.0.1:${onion_service_port_to}/d" /etc/tor/torrc
if [ $3 ]; then
sed -i "/127.0.0.1:${3}/d" /etc/tor/torrc
if [ $4 ]; then
sed -i "/127.0.0.1:${4}/d" /etc/tor/torrc
if [ $5 ]; then
sed -i "/127.0.0.1:${5}/d" /etc/tor/torrc
fi
fi
fi
systemctl restart tor
}