Enable -l flag to work without an argument
authordbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 10 Oct 2007 21:51:18 +0000 (21:51 +0000)
committerdbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 10 Oct 2007 21:51:18 +0000 (21:51 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1105 9efc2488-bf62-4759-914b-345cdb29e865

bin/osrf_ctl.sh

index efc29f5..6d65902 100755 (executable)
@@ -12,9 +12,17 @@ OPT_PID_DIR=""
 
 function usage {
        echo "";
-       echo "usage: $0 -d <pid_dir> -c <c_config> -a <action>";
+       echo "usage: $0 [OPTION]... -c <c_config> -a <action>";
        echo "";
-       echo "Actions include:"
+       echo "Mandatory parameters:";
+       echo -e "  -a\t\taction to perform";
+       echo -e "  -c\t\tfull path to C configuration file (opensrf_core.xml)";
+       echo "";
+       echo "Optional parameters:";
+       echo -e "  -d\t\tstore PID files in this directory";
+       echo -e "  -l\t\taccept 'localhost' as the fully-qualified domain name";
+       echo "";
+       echo "Actions include:";
        echo -e "\tstart_router"
        echo -e "\tstop_router"
        echo -e "\trestart_router"
@@ -31,9 +39,10 @@ function usage {
        echo -e "\tstart_all"
        echo -e "\trestart_all"
        echo "";
-    echo "Example:";
-    echo "  $0 -c opensrf_core.xml -a restart_all";
-    echo "";
+       echo "Examples:";
+       echo "  $0 -c opensrf_core.xml -a restart_all";
+       echo "  $0 -l -c opensrf_core.xml -a restart_all";
+       echo "";
        exit;
 }
 
@@ -41,7 +50,7 @@ function usage {
 # ---------------------------------------------------------------------------
 # Load the command line options and set the global vars
 # ---------------------------------------------------------------------------
-while getopts  "c:a:d:l:h" flag; do
+while getopts  "c:a:d:lh" flag; do
        case $flag in   
                "a")            OPT_ACTION="$OPTARG";;
                "c")            OPT_CONFIG="$OPTARG";;