djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 1 | # $OpenBSD: host-expand.sh,v 1.5 2017/04/30 23:34:55 djm Exp $ |
Damien Miller | 7d06b00 | 2011-01-07 09:54:20 +1100 | [diff] [blame] | 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="expand %h and %n" |
| 5 | |
| 6 | echo 'PermitLocalCommand yes' >> $OBJ/ssh_proxy |
| 7 | printf 'LocalCommand printf "%%%%s\\n" "%%n" "%%h"\n' >> $OBJ/ssh_proxy |
| 8 | |
Tim Rice | 076a3b9 | 2011-01-10 12:56:26 -0800 | [diff] [blame] | 9 | cat >$OBJ/expect <<EOE |
Damien Miller | 7d06b00 | 2011-01-07 09:54:20 +1100 | [diff] [blame] | 10 | somehost |
| 11 | 127.0.0.1 |
| 12 | EOE |
| 13 | |
djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 14 | ${SSH} -F $OBJ/ssh_proxy somehost true >$OBJ/actual |
| 15 | diff $OBJ/expect $OBJ/actual || fail "$tid" |
Damien Miller | 7d06b00 | 2011-01-07 09:54:20 +1100 | [diff] [blame] | 16 | |