Function to remove xmpp

This commit is contained in:
Bob Mottram 2016-07-04 19:36:56 +01:00
parent eadc7fc342
commit ce9091d34a
1 changed files with 34 additions and 0 deletions

View File

@ -119,6 +119,40 @@ function update_prosody_modules {
fi
}
function remove_xmpp_client {
if ! grep -Fxq "install_xmpp_client" $COMPLETION_FILE; then
return
fi
apt-get -y remove --purge profanity
sed '/install_xmpp_client/d' $COMPLETION_FILE
}
function remove_xmpp {
remove_xmpp_client
if ! grep -Fxq "install_xmpp" $COMPLETION_FILE; then
return
fi
iptables -D INPUT -p tcp --dport 5222:5223 -j ACCEPT
iptables -D INPUT -p tcp --dport 5269 -j ACCEPT
iptables -D INPUT -p tcp --dport 5280:5281 -j ACCEPT
function_check save_firewall_settings
save_firewall_settings
function_check remove_onion_service
remove_onion_service xmpp 5222 5223 5269
apt-get -y remove --purge prosody prosody-modules
if [ -d $INSTALL_DIR/prosody-modules ]; then
rm -rf $INSTALL_DIR/prosody-modules
fi
if [ -d /etc/prosody ]; then
rm -rf /etc/prosody
fi
sed '/install_xmpp/d' $COMPLETION_FILE
sed '/XMPP /d' $COMPLETION_FILE
}
function install_xmpp {
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" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return