View | Details | Raw Unified | Return to bug 6684
Collapse All | Expand All

(-)a/debian/scripts/koha-remove (-15 / +49 lines)
Lines 19-27 Link Here
19
19
20
set -e
20
set -e
21
21
22
NAMES="$@"
22
23
23
for name in "$@"
24
SITECONFDIR="/etc/koha/sites"
25
# There has to be a better way of excluding '.' from find. But this works.
26
INSTANCES=`cd $SITECONFDIR && find . -type d -printf " %f" |sed s/\ .\ //`
27
28
if [ -z $NAMES ] ; then
29
  echo "Please specify a Koha instance name. Your choices are:"
30
  echo "$INSTANCES"
31
  exit 1
32
fi
33
34
for name in $NAMES
24
do
35
do
36
    # Does the directory (ie instance) name exist?
37
    if [ ! -d $SITECONFDIR/$name ] ; then
38
	echo Koha configuration directory for instance \"$name\" does not exist, please specify a valid Koha instance
39
	exit 1
40
    fi
41
25
    echo "Removing Koha instance $name"
42
    echo "Removing Koha instance $name"
26
43
27
    mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
44
    mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
Lines 32-43 eof Link Here
32
    
49
    
33
    koha-stop-zebra $name
50
    koha-stop-zebra $name
34
    rm "/etc/apache2/sites-available/$name"
51
    rm "/etc/apache2/sites-available/$name"
35
    rm "/etc/koha/sites/$name/koha-conf.xml"
52
    rm "$SITECONFDIR/$name/koha-conf.xml"
36
    rm "/etc/koha/sites/$name/zebra-biblios.cfg"
53
    rm "$SITECONFDIR/$name/zebra-biblios.cfg"
37
    rm "/etc/koha/sites/$name/zebra-authorities.cfg"
54
    rm "$SITECONFDIR/$name/zebra-authorities.cfg"
38
    rm "/etc/koha/sites/$name/zebra-authorities-dom.cfg"
55
    rm "$SITECONFDIR/$name/zebra-authorities-dom.cfg"
39
    rm "/etc/koha/sites/$name/zebra.passwd"
56
    rm "$SITECONFDIR/$name/zebra.passwd"
40
    rmdir "/etc/koha/sites/$name"
57
    rmdir "$SITECONFDIR/$name"
41
    rm -r "/var/lock/koha/$name"
58
    rm -r "/var/lock/koha/$name"
42
    rm -r "/var/log/koha/$name"
59
    rm -r "/var/log/koha/$name"
43
    rm -r "/var/run/koha/$name"diff --git a/debian/scripts/koha-remove b/debian/scripts/koha-remove
60
    rm -r "/var/run/koha/$name"diff --git a/debian/scripts/koha-remove b/debian/scripts/koha-remove
44
-- a/debian/scripts/koha-remove
61
++ b/debian/scripts/koha-remove
Lines 19-27 Link Here
19
19
20
set -e
20
set -e
21
21
22
NAMES="$@"
22
23
23
for name in "$@"
24
SITECONFDIR="/etc/koha/sites"
25
# There has to be a better way of excluding '.' from find. But this works.
26
INSTANCES=`cd $SITECONFDIR && find . -type d -printf " %f" |sed s/\ .\ //`
27
28
if [ -z $NAMES ] ; then
29
  echo "Please specify a Koha instance name. Your choices are:"
30
  echo "$INSTANCES"
31
  exit 1
32
fi
33
34
for name in $NAMES
24
do
35
do
36
    # Does the directory (ie instance) name exist?
37
    if [ ! -d $SITECONFDIR/$name ] ; then
38
	echo Koha configuration directory for instance \"$name\" does not exist, please specify a valid Koha instance
39
	exit 1
40
    fi
41
25
    echo "Removing Koha instance $name"
42
    echo "Removing Koha instance $name"
26
43
27
    mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
44
    mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
Lines 32-43 eof Link Here
32
    
49
    
33
    koha-stop-zebra $name
50
    koha-stop-zebra $name
34
    rm "/etc/apache2/sites-available/$name"
51
    rm "/etc/apache2/sites-available/$name"
35
    rm "/etc/koha/sites/$name/koha-conf.xml"
52
    rm "$SITECONFDIR/$name/koha-conf.xml"
36
    rm "/etc/koha/sites/$name/zebra-biblios.cfg"
53
    rm "$SITECONFDIR/$name/zebra-biblios.cfg"
37
    rm "/etc/koha/sites/$name/zebra-authorities.cfg"
54
    rm "$SITECONFDIR/$name/zebra-authorities.cfg"
38
    rm "/etc/koha/sites/$name/zebra-authorities-dom.cfg"
55
    rm "$SITECONFDIR/$name/zebra-authorities-dom.cfg"
39
    rm "/etc/koha/sites/$name/zebra.passwd"
56
    rm "$SITECONFDIR/$name/zebra.passwd"
40
    rmdir "/etc/koha/sites/$name"
57
    rmdir "$SITECONFDIR/$name"
41
    rm -r "/var/lock/koha/$name"
58
    rm -r "/var/lock/koha/$name"
42
    rm -r "/var/log/koha/$name"
59
    rm -r "/var/log/koha/$name"
43
    rm -r "/var/run/koha/$name"
60
    rm -r "/var/run/koha/$name"

Return to bug 6684