Add koha-disable, a script to disable a Koha instance.
authorLars Wirzenius <lars@catalyst.net.nz>
Tue, 25 May 2010 01:44:15 +0000 (13:44 +1200)
committerChris Cormack <chrisc@catalyst.net.nz>
Wed, 26 May 2010 04:30:23 +0000 (16:30 +1200)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
debian/koha-common.install
debian/scripts/koha-disable [new file with mode: 0755]
debian/unavailable.html [new file with mode: 0644]

index 9a586bc..a4e3b7f 100644 (file)
@@ -1,6 +1,8 @@
-misc/release_notes/release_notes_3*.txt usr/share/doc/koha-common
+misc/release_notes/release_notes_3*.txt     usr/share/doc/koha-common
 debian/tmp/usr/* usr
 debian/tmp/etc/koha/pazpar2
 debian/tmp/etc/koha/zebradb/[!z]*
 debian/templates/* etc/koha
 debian/koha-post-install-setup usr/sbin
+debian/unavailable.html                     usr/share/koha/intranet/htdocs
+debian/unavailable.html                     usr/share/koha/opac/htdocs
diff --git a/debian/scripts/koha-disable b/debian/scripts/koha-disable
new file mode 100755 (executable)
index 0000000..5d7aa36
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# koha-disable -- disable a Koha instance.
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+die() {
+    echo "$@" 1>&2
+    exit 1
+}
+
+
+# Parse command line.
+[ "$#" = 1 ] || die "Usage: $0 instancename..."
+
+
+for name in "$@"
+do
+    sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-disable.conf\)$:\1:' \
+        "/etc/apache2/sites-available/$name"
+done
+
+/etc/init.d/apache2 restart
diff --git a/debian/unavailable.html b/debian/unavailable.html
new file mode 100644 (file)
index 0000000..50c57f3
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Unavailable</title>
+</head>
+<body>
+
+<h1>Sorry!</h1>
+
+<p>The Koha site you are trying to access is currently unavailable,
+probably because of maintenance.
+This is not at all your fault, and we apologize for any inconvenience
+the downtime may cause you. Please check back in a while. 
+We hope to get things back up soon.</p>
+
+</body>
+</html>