From 3c0a8473abada7603fdc914bd325468cc8ee5b90 Mon Sep 17 00:00:00 2001
From: Tomas Cohen Arazi <tomascohen@gmail.com>
Date: Mon, 29 Apr 2013 15:22:09 -0300
Subject: [PATCH 2/2] Bug 10104 - Followup: fix param check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
As noted by Mason on bug 10101, the check was not working for zero arguments.
Sponsored-by: Universidad Nacional de Córdoba
---
debian/scripts/koha-disable | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/debian/scripts/koha-disable b/debian/scripts/koha-disable
index 7affe5e..75e3997 100755
--- a/debian/scripts/koha-disable
+++ b/debian/scripts/koha-disable
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# koha-disable -- disable Koha instances.
+# koha-disable - disable Koha instances.
# Copyright 2010 Catalyst IT, Ltd
#
# This program is free software: you can redistribute it and/or modify
@@ -73,8 +73,19 @@ disable_instance()
fi
}
+usage()
+{
+ local scriptname=$0
+ cat <<EOF
+Disables Koha instances.
+
+Usage: $scriptname instancename1 instancename2...
+
+EOF
+}
+
# Parse command line.
-[ "$#" > 1 ] || die "Usage: $0 instancename..."
+[ $# -ge 1 ] || ( usage ; die "Missing instance name..." )
restart_apache="no"
@@ -96,4 +107,3 @@ if [ "$restart_apache" = "yes" ]; then
fi
exit 0
-
--
1.7.10.4