X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=debian%2Fscripts%2Fkoha-disable;h=2e2e67ab5cfa5a788ab588ce7b59e2282ce1d6d8;hb=1acb998beb245ff038ea81e72d765eb101ca6b0a;hp=5d7aa3661d904f545b09358d7a3cf42808364d82;hpb=71e585df2f9efa39d10e9112023413a94df63ceb;p=koha.git diff --git a/debian/scripts/koha-disable b/debian/scripts/koha-disable index 5d7aa3661d..2e2e67ab5c 100755 --- a/debian/scripts/koha-disable +++ b/debian/scripts/koha-disable @@ -1,6 +1,6 @@ #!/bin/sh # -# koha-disable -- disable a Koha instance. +# koha-disable - disable Koha instances. # Copyright 2010 Catalyst IT, Ltd # # This program is free software: you can redistribute it and/or modify @@ -19,21 +19,71 @@ set -e - -die() { - echo "$@" 1>&2 +# include helper functions +if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then + . "/usr/share/koha/bin/koha-functions.sh" +else + echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 exit 1 +fi + +disable_instance() +{ + local instancename=$1 + local instancefile=$(get_apache_config_for "$instancename") + + if [ "$instancefile" = "" ]; then + echo 2 + elif is_enabled $instancename; then + sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-disable.conf\)$:\1:' "$instancefile" + echo 0 + else + echo 1 + fi } +usage() +{ + local scriptname=$0 + cat <