2014-09-20 17:23:57 +00:00
#!/bin/sh -e
CONFIGFILE="/etc/alternc/my.cnf"
MENUFILE="/etc/alternc/menulist.txt"
case "$1" in
remove)
# TODO : we don't purge *-ssl vhosts or *-ssl templates, they may break the hosting ...
2015-02-13 09:49:57 +00:00
if [ -e "$CONFIGFILE" -a -x "/usr/bin/mysql" ]; then
2015-02-13 13:31:41 +00:00
mysql --defaults-file=${CONFIGFILE} -f -e "DELETE FROM domaines_type WHERE name IN ('vhost-ssl','vhost-mixssl','roundcube-ssl','squirrelmail-ssl','panel-ssl','php52-ssl','php52-mixssl');"
mysql --defaults-file=${CONFIGFILE} -f -e "UPDATE sub_domaines SET web_action='DELETE' WHERE type IN ('vhost-ssl','vhost-mixssl','roundcube-ssl','squirrelmail-ssl','panel-ssl','php52-ssl','php52-mixssl');"
2015-02-13 09:49:57 +00:00
fi
2015-02-13 16:00:22 +00:00
echo -e "\033[31m**********************************************"
echo "* *"
echo "* ALTERNC-SSL ACTION REQUESTED *"
echo "* *"
echo "* Please run alternc.install to fully remove *"
echo "* *"
echo "**********************************************"
echo -e "\033[0m"
2015-02-13 09:49:57 +00:00
;;
2014-09-20 17:23:57 +00:00
purge)
2015-02-13 09:49:57 +00:00
# Purge the certificate and alias table:
if [ -e "$CONFIGFILE" -a -x "/usr/bin/mysql" ]; then
mysql --defaults-file=${CONFIGFILE} -f -e "DROP TABLE IF EXISTS certificate;"
mysql --defaults-file=${CONFIGFILE} -f -e "DROP TABLE IF EXISTS certif_alias;"
2015-02-13 16:00:22 +00:00
mysql --defaults-file=${CONFIGFILE} -f -e "DROP TABLE IF EXISTS certif_hosts;"
2015-02-13 09:49:57 +00:00
fi
2014-09-20 17:23:57 +00:00
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#