Sfoglia il codice sorgente

don't run determine_service_tool if -t options is used; -l option conflicts with -t

Marcin Dulak 10 anni fa
parent
commit
72867dedbb
1 ha cambiato i file con 11 aggiunte e 4 eliminazioni
  1. 11 4
      check_service.sh

+ 11 - 4
check_service.sh

@@ -203,7 +203,18 @@ do
 done
 
 os_check
+
+if [ $MANUAL -eq 1 ]; then
+SERVICETOOL=$MANUALSERVICETOOL
+else
 determine_service_tool
+fi
+
+# -l conflicts with -t                                                                                                                                                   
+if [ $MANUAL -eq 1 ] && [ $LIST -eq 1 ]; then
+    echo "Options conflict: \`\`-t'' and \`\`-l''"
+    exit 2
+fi
 
 if [ $LIST -eq 1 ]; then
         if [[ $LISTTOOL != null ]]; then
@@ -215,10 +226,6 @@ if [ $LIST -eq 1 ]; then
         fi
 fi
 
-if [ $MANUAL -eq 1 ]; then
-SERVICETOOL=$MANUALSERVICETOOL
-fi
-
 # Check the status of a service
 STATUS_MSG=$(eval "$SERVICETOOL" 2>&1)