Just remove /etc/alternc files when purge required by user
This commit is contained in:
parent
7eacd4bd6b
commit
28715960c7
|
@ -4,8 +4,6 @@ set -e
|
||||||
|
|
||||||
. /usr/share/debconf/confmodule
|
. /usr/share/debconf/confmodule
|
||||||
|
|
||||||
ALTERNC_DB=$(cat /etc/alternc/my.cnf |grep ^database|cut -d '"' -f 2)
|
|
||||||
|
|
||||||
# * postrm remove
|
# * postrm remove
|
||||||
# * postrm purge
|
# * postrm purge
|
||||||
# * old-postrm upgrade new-version
|
# * old-postrm upgrade new-version
|
||||||
|
@ -17,42 +15,48 @@ ALTERNC_DB=$(cat /etc/alternc/my.cnf |grep ^database|cut -d '"' -f 2)
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
purge)
|
purge)
|
||||||
rm -f /etc/alternc/local.sh /etc/alternc/my_mail.cnf /etc/alternc/my.cnf /etc/alternc/bureau.conf
|
rm -f /etc/alternc/local.sh /etc/alternc/my_mail.cnf /etc/alternc/bureau.conf
|
||||||
rm -f /var/backups/alternc/etc-installed.tar.gz
|
rm -f /var/backups/alternc/etc-installed.tar.gz
|
||||||
|
|
||||||
# Purge database?
|
# FIXME : remove following commented lines if we are sure
|
||||||
db_input high alternc/postrm_remove_databases || true
|
# to not drop database and remove files (except /etc/alternc)
|
||||||
db_go
|
# when Alternc is purged
|
||||||
db_get alternc/postrm_remove_databases || true
|
|
||||||
if [ "$RET" = "true" ]; then
|
|
||||||
/usr/bin/mysql --defaults-file=/etc/alternc/my.cnf -Bs -e "DROP DATABASE $ALTERNC_DB"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Purge datafiles?
|
# Maybe tell to user how to do if he want to drop db and/or remove files ?
|
||||||
db_input high alternc/postrm_remove_datafiles || true
|
|
||||||
db_go
|
# Purge database?
|
||||||
db_get alternc/postrm_remove_datafiles || true
|
#db_input high alternc/postrm_remove_databases || true
|
||||||
if [ "$RET" = "true" ]; then
|
#db_go
|
||||||
rm -rf /var/backups/alternc /var/alternc/dns /var/alternc/html /var/alternc/redir
|
#db_get alternc/postrm_remove_databases || true
|
||||||
fi
|
#if [ "$RET" = "true" ]; then
|
||||||
|
# /usr/bin/mysql --defaults-file=/etc/alternc/my.cnf -Bs -e "DROP DATABASE $ALTERNC_DB"
|
||||||
|
#fi
|
||||||
|
|
||||||
|
# Purge datafiles
|
||||||
|
#db_input high alternc/postrm_remove_datafiles || true
|
||||||
|
#db_go
|
||||||
|
#db_get alternc/postrm_remove_datafiles || true
|
||||||
|
#if [ "$RET" = "true" ]; then
|
||||||
|
# rm -rf /var/backups/alternc /var/alternc/dns /var/alternc/html /var/alternc/redir
|
||||||
|
#fi
|
||||||
|
|
||||||
# Purge bind zones
|
# Purge bind zones
|
||||||
db_input high alternc/postrm_remove_bind || true
|
#db_input high alternc/postrm_remove_bind || true
|
||||||
db_go
|
#db_go
|
||||||
db_get alternc/postrm_remove_bind || true
|
#db_get alternc/postrm_remove_bind || true
|
||||||
if [ "$RET" = "true" ]; then
|
#if [ "$RET" = "true" ]; then
|
||||||
rm -rf /var/alternc/bind /etc/bind/templates
|
# rm -rf /var/alternc/bind /etc/bind/templates
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
# Purge mailboxes
|
# Purge mailboxes
|
||||||
db_input high alternc/postrm_remove_mailboxes || true
|
#db_input high alternc/postrm_remove_mailboxes || true
|
||||||
db_go
|
#db_go
|
||||||
db_get alternc/postrm_remove_mailboxes || true
|
#db_get alternc/postrm_remove_mailboxes || true
|
||||||
if [ "$RET" = "true" ]; then
|
#if [ "$RET" = "true" ]; then
|
||||||
rm -rf /var/alternc/mail
|
# rm -rf /var/alternc/mail
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
rm -rf /var/alternc/apacheconf /var/alternc/cgi-bin /var/alternc/bureau /var/alternc/exec.usr /var/alternc/mla /var/alternc/redir /var/alternc/tmp /var/log/alternc
|
#rm -rf /var/alternc/apacheconf /var/alternc/cgi-bin /var/alternc/bureau /var/alternc/exec.usr /var/alternc/mla /var/alternc/redir /var/alternc/tmp /var/log/alternc
|
||||||
rm -f /etc/apache*/conf.d/override_php.conf /etc/apache*/conf.d/alternc-ssl.conf /etc/apache*/conf.d/alternc.conf
|
rm -f /etc/apache*/conf.d/override_php.conf /etc/apache*/conf.d/alternc-ssl.conf /etc/apache*/conf.d/alternc.conf
|
||||||
rm -f /etc/php*/conf.d/alternc.ini
|
rm -f /etc/php*/conf.d/alternc.ini
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue