Do not attempt to remove database if no mysql instance (fix a piuparts error)

pull/605/head
Emmanuel Papin 2014-11-28 21:36:11 +01:00
parent b0e3671f99
commit 578dcef4b8
1 changed files with 7 additions and 3 deletions

View File

@ -21,8 +21,12 @@ if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
fi
if [ "$1" = "purge" ]; then
echo 'delete from user where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql
echo 'delete from db where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql
mysqladmin --defaults-file=/etc/mysql/debian.cnf -f drop zm
if [ -e "/etc/init.d/mysql" ]; then
echo 'delete from user where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql
echo 'delete from db where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql
mysqladmin --defaults-file=/etc/mysql/debian.cnf -f drop zm
else
echo 'mysql not found, assuming remote server.'
fi
fi
#DEBHELPER#