Просмотр исходного кода

Merge pull request #14 from marcindulak/master

trying to improve the logic of check_service.sh a bit
Jon Schipp 9 лет назад
Родитель
Сommit
46bab3adfa
1 измененных файлов с 11 добавлено и 4 удалено
  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)