diff options
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r-- | regress/test-exec.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index aac8aa5c2..a1bab832f 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: test-exec.sh,v 1.47 2013/11/09 05:41:34 dtucker Exp $ | 1 | # $OpenBSD: test-exec.sh,v 1.48 2014/07/06 07:42:03 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | #SUDO=sudo | 4 | #SUDO=sudo |
@@ -240,13 +240,20 @@ md5 () { | |||
240 | # helper | 240 | # helper |
241 | cleanup () | 241 | cleanup () |
242 | { | 242 | { |
243 | if [ "x$SSH_PID" != "x" ]; then | ||
244 | if [ $SSH_PID -lt 2 ]; then | ||
245 | echo bad pid for ssh: $SSH_PID | ||
246 | else | ||
247 | kill $SSH_PID | ||
248 | fi | ||
249 | fi | ||
243 | if [ -f $PIDFILE ]; then | 250 | if [ -f $PIDFILE ]; then |
244 | pid=`$SUDO cat $PIDFILE` | 251 | pid=`$SUDO cat $PIDFILE` |
245 | if [ "X$pid" = "X" ]; then | 252 | if [ "X$pid" = "X" ]; then |
246 | echo no sshd running | 253 | echo no sshd running |
247 | else | 254 | else |
248 | if [ $pid -lt 2 ]; then | 255 | if [ $pid -lt 2 ]; then |
249 | echo bad pid for ssh: $pid | 256 | echo bad pid for sshd: $pid |
250 | else | 257 | else |
251 | $SUDO kill $pid | 258 | $SUDO kill $pid |
252 | trace "wait for sshd to exit" | 259 | trace "wait for sshd to exit" |