Function to remove sip

This commit is contained in:
Bob Mottram 2016-07-04 13:11:14 +01:00
parent 06ec000f58
commit 089b8e204b
1 changed files with 30 additions and 0 deletions

View File

@ -35,6 +35,36 @@ VOIP_TURN_PORT=3478
VOIP_TURN_TLS_PORT=5349 VOIP_TURN_TLS_PORT=5349
VOIP_TURN_NONCE= VOIP_TURN_NONCE=
function remove_sip {
if ! grep -Fxq "install_sip" $COMPLETION_FILE; then
return
fi
iptables -D INPUT -p udp --dport $VOIP_TURN_PORT -j ACCEPT
iptables -D INPUT -p tcp --dport $VOIP_TURN_PORT -j ACCEPT
iptables -D INPUT -p tcp --dport $VOIP_TURN_TLS_PORT -j ACCEPT
iptables -D INPUT -p udp --dport $SIP_PORT -j ACCEPT
iptables -D INPUT -p tcp --dport $SIP_PORT -j ACCEPT
iptables -D INPUT -p udp --dport $SIP_TLS_PORT -j ACCEPT
iptables -D INPUT -p tcp --dport $SIP_TLS_PORT -j ACCEPT
function_check save_firewall_settings
save_firewall_settings
function_check remove_onion_service
remove_onion_service sip ${SIP_PORT}
apt-get -y remove --purge sipwitch
apt-get -y remove --purge turnserver
if [ -f /etc/sipwitch.conf ]; then
rm /etc/sipwitch.conf
fi
if [ -d /etc/turnserver ]; then
rm -rf /etc/turnserver
fi
sed -i '/install_sip/d' $COMPLETION_FILE
sed -i '/configure_firewall_for_voip_turn/d' $COMPLETION_FILE
sed -i '/configure_firewall_for_sip4/d' $COMPLETION_FILE
}
function configure_firewall_for_voip_turn { function configure_firewall_for_voip_turn {
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" ]]; then
return return