set -e
+args=$(getopt -l keep-mysql -o k -n $0 -- "$@")
+set -- $args
+while [ ! -z "$1" ]
+do
+ case "$1" in
+ -k|--keep-mysql) keepmysql=1; exit;;
+ *) break;;
+ esac
+ shift
+done
+
for name in "$@"
do
echo "Removing Koha instance $name"
- mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
+ if [ "$keepmysql" != "1" ]
+ then
+ mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
DROP USER \`koha_$name\`;
DROP DATABASE \`koha_$name\`;
FLUSH PRIVILEGES;
eof
+ fi #`
koha-stop-zebra $name
[ -f "/etc/apache2/sites-available/$name" ] && \