testing: only try to kill backgrounded sshd if process exists.
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Sun, 26 Oct 2008 05:14:49 +0000 (01:14 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Sun, 26 Oct 2008 05:14:49 +0000 (01:14 -0400)
tests/basic

index cb3730daddc27bef1cfddaebbf77f5858d31a959..a917f9f2657ec59fcd5e7465cf549251ae89c40c 100755 (executable)
@@ -26,8 +26,10 @@ cleanup() {
     echo
     read -p "press enter to cleanup and remove tmp:"
 
-    echo "### stop sshd..."
-    kill %1
+    if ( jobs %1 >/dev/null 2>/dev/null ) ; then 
+       echo "### stopping still-running sshd..."
+       kill %1
+    fi
 
     echo "### removing temp dir..."
     rm -rf "$TEMPDIR"