Stealth onions

This commit is contained in:
Bob Mottram 2016-11-06 15:15:35 +00:00
parent 99ea6ab974
commit 23147fe355
1 changed files with 2 additions and 0 deletions

View File

@ -71,6 +71,7 @@ function wait_for_onion_service {
function remove_onion_service {
onion_service_name="$1"
onion_service_port_to=$2
sed -i "/stealth ${onion_service_name}/d" /etc/tor/torrc
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
@ -107,6 +108,7 @@ function add_onion_service {
if ! grep -q "hidden_service_${onion_service_name}" /etc/tor/torrc; then
echo "HiddenServiceDir /var/lib/tor/hidden_service_${onion_service_name}/" >> /etc/tor/torrc
echo "HiddenServicePort ${onion_service_port_from} 127.0.0.1:${onion_service_port_to}" >> /etc/tor/torrc
echo "HiddenServiceAuthorizeClient stealth ${onion_service_name}" >> /etc/tor/torrc
fi
onion_update