Bug 10104 - Followup: fix param check
authorTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 29 Apr 2013 18:22:09 +0000 (15:22 -0300)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Thu, 2 May 2013 01:59:27 +0000 (21:59 -0400)
As noted by Mason on bug 10101, the check was not working for zero arguments.

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
debian/scripts/koha-disable

index 50785ef..75e3997 100755 (executable)
@@ -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"