You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2010/09/28 10:44:08 UTC

svn commit: r1002052 - /directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/apacheds.init

Author: pamarcelot
Date: Tue Sep 28 08:44:08 2010
New Revision: 1002052

URL: http://svn.apache.org/viewvc?rev=1002052&view=rev
Log:
Fixed the init script on some Linux environments (especially Ubuntu 10.04).

Modified:
    directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/apacheds.init

Modified: directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/apacheds.init
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/apacheds.init?rev=1002052&r1=1002051&r2=1002052&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/apacheds.init (original)
+++ directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/apacheds.init Tue Sep 28 08:44:08 2010
@@ -351,7 +351,18 @@ testpid() {
 }
 
 usage() {
-    echo "Please enter an instance name..."
+    # Command parameter
+    if [ "x$1" = "x" ]; 
+    then
+        echo "Please enter a command..."
+    fi
+
+    # Instance parameter
+    if [ "x$2" = "x" ]; 
+    then
+        echo "Please enter an instance name..."
+    fi
+    
     echo "Usage: $0 <command> <instance name>"
     echo "  Available Commands: "
     echo "      console     - Run in interactive mode with log output to the console."
@@ -490,20 +501,27 @@ dump() {
 
 list() {
   echo "Available instances..."
-  for instance in $INSTANCE_HOME/* ; do
+  for instance in $INSTANCES_DIRECTORY/* ; do
 	echo "	" `basename $instance`;
   done
 }
 
-# Make sure they entered an instance name
-if [[ ( $2 == "" ) && ( $1 == "start" || $1 == "stop" || $1 == "status" || $1 == "dump" ) ]]
+#
+# Checking parameters
+#
+
+# Command parameter
+if [ "x$1" = "x" ]; 
+then
+  usage $*
+  exit 2
+fi
+
+# Instance parameter
+if [ "x$2" = "x" ]; 
 then
-	usage
-	echo
-	echo "Please enter an instance name to $1..."
-	echo
-	list
-	exit 1
+  usage $*
+  exit 2
 fi
 
 case "$1" in