diff --git a/src/freedombone-utils-turn b/src/freedombone-utils-turn index 49b8f5a9..91afbd84 100755 --- a/src/freedombone-utils-turn +++ b/src/freedombone-utils-turn @@ -48,6 +48,7 @@ function generate_turn_key { function remove_turn { firewall_remove ${TURN_HTTP_PORT} + firewall_remove ${TURN_PORT} systemctl stop turn systemctl disable turn if [ -f /etc/systemd/system/turn.service ]; then @@ -59,6 +60,7 @@ function remove_turn { rm -rf /var/lib/turn sed -i "/# TURN Server/,/# End of TURN Server/d" /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME} remove_onion_service turn ${TURN_ONION_PORT} + rm /etc/avahi/services/turn.service systemctl restart nginx } @@ -173,10 +175,26 @@ function install_turn { systemctl daemon-reload systemctl start turn - firewall_add turn ${TURN_HTTP_PORT} + firewall_add turn ${TURN_PORT} + firewall_add turn-http ${TURN_HTTP_PORT} TURN_ONION_HOSTNAME=$(add_onion_service turn ${TURN_PORT} ${TURN_ONION_PORT}) + echo '' > /etc/avahi/services/turn.service + echo '' >> /etc/avahi/services/turn.service + echo '' >> /etc/avahi/services/turn.service + echo ' %h TURN' >> /etc/avahi/services/turn.service + echo ' ' >> /etc/avahi/services/turn.service + echo ' _turn._tcp' >> /etc/avahi/services/turn.service + echo " $TURN_PORT" >> /etc/avahi/services/turn.service + echo ' ' >> /etc/avahi/services/turn.service + echo ' ' >> /etc/avahi/services/turn.service + echo ' _turn._udp' >> /etc/avahi/services/turn.service + echo " $TURN_PORT" >> /etc/avahi/services/turn.service + echo ' ' >> /etc/avahi/services/turn.service + echo '' >> /etc/avahi/services/turn.service + + systemctl restart avahi-daemon systemctl restart nginx }