From 5281b96330880d479e14c3250aaa516c19ba99bb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 4 Jul 2016 08:14:09 +0100 Subject: [PATCH] Function to remove an onion service --- src/freedombone-utils-onion | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/freedombone-utils-onion b/src/freedombone-utils-onion index cb8850b3..5c576d83 100755 --- a/src/freedombone-utils-onion +++ b/src/freedombone-utils-onion @@ -54,6 +54,14 @@ function wait_for_onion_service { fi } +function remove_onion_service { + onion_service_name="$1" + 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 + systemctl restart tor +} + function add_onion_service { onion_service_name="$1" onion_service_port_from=$2 @@ -120,19 +128,19 @@ function create_avahi_onion_domains { return fi if [ $MICROBLOG_DOMAIN_NAME ]; then - function_check create_avahi_service + function_check create_avahi_service create_avahi_service microblog http tcp $MICROBLOG_ONION_PORT fi if [ $FULLBLOG_DOMAIN_NAME ]; then - function_check create_avahi_service + function_check create_avahi_service create_avahi_service blog http tcp $BLOG_ONION_PORT fi if [ $GIT_DOMAIN_NAME ]; then - function_check create_avahi_service + function_check create_avahi_service create_avahi_service git http tcp $GIT_ONION_PORT fi if [ $WIKI_DOMAIN_NAME ]; then - function_check create_avahi_service + function_check create_avahi_service create_avahi_service wiki http tcp $WIKI_ONION_PORT fi }