Work on deb packages

This commit is contained in:
Laurent Destailleur 2011-08-14 19:47:27 +00:00
parent 26d546945f
commit af88775b2b

View File

@ -20,16 +20,16 @@ set -e
lighttpd_remove() { lighttpd_remove() {
if [ -f /etc/lighttpd/conf-available/50-dolibarr.conf ] ; then if [ -f /etc/lighttpd/conf-available/50-dolibarr.conf ] ; then
echo "Remove link for Lighttpd config file" echo "postrm Remove link for Lighttpd config file"
rm -f /etc/lighttpd/conf-available/50-dolibarr.conf rm -f /etc/lighttpd/conf-available/50-dolibarr.conf
if which lighty-enable-mod >/dev/null 2>&1 ; then if which lighty-enable-mod >/dev/null 2>&1 ; then
lighty-disable-mod dolibarr lighty-disable-mod dolibarr
else else
echo "Lighttpd not installed, skipping" echo "postrm Lighttpd not installed, skipping"
fi fi
# See bug #448682 # See bug #448682
if [ -h /etc/lighttpd/conf-enabled/50-dolibarr.conf ] ; then if [ -h /etc/lighttpd/conf-enabled/50-dolibarr.conf ] ; then
echo 'Manually deleting lighttpd/dolibarr configuration link' echo "postrm Manually deleting lighttpd/dolibarr configuration link"
rm /etc/lighttpd/conf-enabled/50-dolibarr.conf rm /etc/lighttpd/conf-enabled/50-dolibarr.conf
fi fi
fi fi
@ -37,7 +37,7 @@ lighttpd_remove() {
apache_remove() { apache_remove() {
if [ -d /etc/$webserver/conf.d ] && [ -L /etc/$webserver/conf.d/dolibarr.conf ]; then if [ -d /etc/$webserver/conf.d ] && [ -L /etc/$webserver/conf.d/dolibarr.conf ]; then
echo "Remove link for Apache config file" echo "postrm Remove link for Apache config file"
rm -f /etc/$webserver/conf.d/dolibarr.conf rm -f /etc/$webserver/conf.d/dolibarr.conf
fi fi
} }
@ -179,10 +179,10 @@ case "$1" in
# Now run the drop user # Now run the drop user
if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'localhost';\"" ; then if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'localhost';\"" ; then
echo Database login $dbuser removed echo postrm Database login $dbuser removed
else else
error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'localhost';\"" error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'localhost';\""
echo $error echo postrm $error
fi fi
# Now run the drop commands # Now run the drop commands
@ -191,20 +191,20 @@ case "$1" in
if eval $mysqlcmd -f -e "\"DROP DATABASE $dbname;\"" ; then if eval $mysqlcmd -f -e "\"DROP DATABASE $dbname;\"" ; then
if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then
error="Database $dbname NOT successfully droped. You have to do it manually." error="Database $dbname NOT successfully droped. You have to do it manually."
echo $error echo postrm $error
else else
status=drop status=drop
fi fi
else else
error="Unable to run the drop database script." error="Unable to run the drop database script."
echo $error echo postrm $error
fi fi
else else
status=nothing status=nothing
log="${log}Database $dbname already not exists." log="${log}Database $dbname already not exists."
fi fi
echo "Remove directory $docdir" echo "postrm Remove directory $docdir"
rm -rf $docdir ; rm -rf $docdir ;
else else