Function to remove sip
This commit is contained in:
parent
06ec000f58
commit
089b8e204b
|
@ -35,6 +35,36 @@ VOIP_TURN_PORT=3478
|
|||
VOIP_TURN_TLS_PORT=5349
|
||||
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 {
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue