[Koha-patches] [PATCH 16/28] Add koha-disable, a script to disable a Koha instance.

Lars Wirzenius lars at catalyst.net.nz
Tue May 25 03:44:15 CEST 2010


---
 debian/koha-common.install  |    4 +++-
 debian/scripts/koha-disable |   39 +++++++++++++++++++++++++++++++++++++++
 debian/unavailable.html     |   19 +++++++++++++++++++
 3 files changed, 61 insertions(+), 1 deletions(-)
 create mode 100755 debian/scripts/koha-disable
 create mode 100644 debian/unavailable.html

diff --git a/debian/koha-common.install b/debian/koha-common.install
index 9a586bc..a4e3b7f 100644
--- a/debian/koha-common.install
+++ b/debian/koha-common.install
@@ -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
index 0000000..5d7aa36
--- /dev/null
+++ b/debian/scripts/koha-disable
@@ -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
index 0000000..50c57f3
--- /dev/null
+++ b/debian/unavailable.html
@@ -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>
-- 
1.7.1




More information about the Koha-patches mailing list