(bug #4084) fix offline circ
[koha.git] / debian / scripts / koha-remove
blob97399cca35e7696e58e392f12afeee5c796a86f4
1 #!/bin/sh
3 # koha-remove -- Remove a Koha instance.
4 # Copyright 2010 Catalyst IT, Ltd
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 set -e
23 for name in "$@"
25 echo "Removing Koha instance $name"
27 mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
28 DROP USER 'koha_$name';
29 DROP DATABASE koha_$name;
30 FLUSH PRIVILEGES;
31 eof
33 koha-stop-zebra $name
34 rm "/etc/apache2/sites-available/$name"
35 rm "/etc/koha/sites/$name/koha-conf.xml"
36 rm "/etc/koha/sites/$name/zebra-biblios.cfg"
37 rm "/etc/koha/sites/$name/zebra-authorities.cfg"
38 rm "/etc/koha/sites/$name/zebra-authorities-dom.cfg"
39 rm "/etc/koha/sites/$name/zebra.passwd"
40 rmdir "/etc/koha/sites/$name"
41 rm -r "/var/lock/koha/$name"
42 rm -r "/var/log/koha/$name"
43 rm -r "/var/run/koha/$name"
44 deluser --quiet "$name-koha"
45 a2dissite "$name"
46 done
48 service apache2 restart