Kaynağa Gözat

Aligned testing for empty result.

Michael Honkoop 1 hafta önce
ebeveyn
işleme
a69f1fa9eb
1 değiştirilmiş dosya ile 6 ekleme ve 6 silme
  1. 6 6
      localchecks/groupwise.sh

+ 6 - 6
localchecks/groupwise.sh

@@ -83,14 +83,14 @@ then
         echo "DEBUG: $SERVICE gwPOA is enabled in config, checking for the process."
     fi
     gwPOAProcess=$(pgrep -x gwpoa)
-    if [ ! -z "$gwPOAProcess" ]
+    if [[ -n "$gwPOAProcess" ]]
     then
         if [ "$debug" -eq 1 ]
         then
             echo "DEBUG:We found a $SERVICE gwPOA process ID: $gwPOAProcess"
         fi
         gwPOAListener=$(ss -lpn | grep "$gwPOAProcess" |awk '{print $5}' | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' )
-        if [ ! -z "$gwPOAListener" ]
+        if [[ -n "$gwPOAListener" ]]
         then
             if [ "$debug" -eq 1 ]
             then
@@ -120,10 +120,10 @@ then
         echo "DEBUG: $SERVICE gwIA is enabled in config, checking for the process."
     fi
     gwIAProcess=$(pgrep -x gwia)
-    if [ ! -z "$gwIAProcess" ]
+    if [[ -n "$gwIAProcess" ]]
     then
         gwIAListener=$(ss -lpn | grep "$gwIAProcess" |awk '{print $5}' | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')
-        if [ ! -z "$gwIAListener" ]
+        if [[ -n "$gwIAListener" ]]
         then
             if [ "$debug" -eq 1 ]
             then
@@ -147,14 +147,14 @@ then
 fi
 
 gwAdminProcess=$(pgrep -f 'gwadmin\.jar')
-if [ ! -z "$gwAdminProcess" ]
+if [[ -n "$gwAdminProcess" ]]
 then
     if [ "$debug" -eq 1 ]
     then
         echo "DEBUG:We found a $SERVICE gwAdmin process ID: $gwAdminProcess"
     fi
     gwAdminListener=$(ss -lpn| grep "$gwAdminProcess" | awk '{print $5}' | grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u | sed 's/^::ffff://' | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')
-    if [ ! -z "$gwAdminListener" ]
+    if [[ -n "$gwAdminListener" ]]
     then
         if [ "$debug" -eq 1 ]
         then