diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2015-03-03 17:53:41 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2015-03-03 17:53:41 +0000 |
commit | 2b4563c06aaa8db79326a9bca7f19f8af3c95409 (patch) | |
tree | 8f44d38278e1021750331523a83f0ec97515f455 /regress/usr.bin | |
parent | 7adf2219d60287146a9408eb0b75d019c268815c (diff) |
reorder logic for better portability; patch from Roumen Petrov
Diffstat (limited to 'regress/usr.bin')
-rw-r--r-- | regress/usr.bin/ssh/hostkey-rotate.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/regress/usr.bin/ssh/hostkey-rotate.sh b/regress/usr.bin/ssh/hostkey-rotate.sh index d964b35c279..b5d542d1208 100644 --- a/regress/usr.bin/ssh/hostkey-rotate.sh +++ b/regress/usr.bin/ssh/hostkey-rotate.sh @@ -1,4 +1,4 @@ -# $OpenBSD: hostkey-rotate.sh,v 1.1 2015/01/26 06:12:18 djm Exp $ +# $OpenBSD: hostkey-rotate.sh,v 1.2 2015/03/03 17:53:40 djm Exp $ # Placed in the Public Domain. tid="hostkey rotate" @@ -38,11 +38,10 @@ expect_nkeys() { check_key_present() { _type=$1 _kfile=$2 - _prog='print $2 " " $3' test "x$_kfile" = "x" && _kfile="$OBJ/hkr.${_type}.pub" - _ktext=`awk "/ $_type / { $_prog }" < $OBJ/known_hosts` || \ + _kpub=`awk "/$_type /"' { print $2 }' < $_kfile` || \ fatal "awk failed" - grep -q "$_ktext" $_kfile + fgrep "$_kpub" $OBJ/known_hosts > /dev/null } cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy @@ -110,7 +109,7 @@ dossh -oStrictHostKeyChecking=yes -oHostKeyAlgorithms=ssh-rsa expect_nkeys 1 "learn hostkeys" check_key_present ssh-rsa || fail "didn't learn changed key" -# $OpenBSD: hostkey-rotate.sh,v 1.1 2015/01/26 06:12:18 djm Exp $ +# $OpenBSD: hostkey-rotate.sh,v 1.2 2015/03/03 17:53:40 djm Exp $ # Placed in the Public Domain. tid="hostkey rotate" |