Add exit status to notification time calculation
[doctor.git] / tests / run.sh
index 292a7ce..ee96da9 100755 (executable)
@@ -484,7 +484,11 @@ calculate_notification_time() {
         exit 1
     fi
     echo "$notified $detected" | \
-        awk '{d = $1 - $2; if (d < 1 && d > 0) print d " OK"; else print d " NG"}'
+        awk '{
+            d = $1 - $2;
+            if (d < 1 && d > 0) { print d " OK"; exit 0 }
+            else { print d " NG"; exit 1 }
+        }'
 }
 
 check_host_status() {