Merge back shell portability changes bringing it back in sync with
authordtucker <dtucker@openbsd.org>
Wed, 2 Jun 2021 00:17:45 +0000 (00:17 +0000)
committerdtucker <dtucker@openbsd.org>
Wed, 2 Jun 2021 00:17:45 +0000 (00:17 +0000)
-portable.

regress/usr.bin/ssh/ssh2putty.sh

index 5b2d795..7fcb3f0 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $OpenBSD: ssh2putty.sh,v 1.7 2021/06/01 23:56:20 dtucker Exp $
+#      $OpenBSD: ssh2putty.sh,v 1.8 2021/06/02 00:17:45 dtucker Exp $
 
 if test "x$1" = "x" -o "x$2" = "x" -o "x$3" = "x" ; then
        echo "Usage: ssh2putty hostname port ssh-private-key"
@@ -13,7 +13,9 @@ KEYFILE=$3
 OPENSSL="${OPENSSL:-openssl}"
 
 # XXX - support DSA keys too
-if ! grep -q "BEGIN RSA PRIVATE KEY" $KEYFILE ; then
+if grep "BEGIN RSA PRIVATE KEY" $KEYFILE >/dev/null 2>&1 ; then
+       :
+else
        echo "Unsupported private key format"
        exit 1
 fi