-# $OpenBSD: multiplex.sh,v 1.24 2014/07/15 15:54:15 millert Exp $
+# $OpenBSD: multiplex.sh,v 1.25 2014/07/22 01:32:12 djm Exp $
# Placed in the Public Domain.
CTL=$OBJ/ctl-sock
|| fail "connect to local forward path failed"
${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \
|| fail "cancel local forward failed"
-N=$(echo "" | nc -U $OBJ/unix-1.fwd 2>&1 | wc -l)
+N=$(echo "xyzzy" | nc -U $OBJ/unix-1.fwd 2>&1 | grep "xyzzy" | wc -l)
test ${N} -eq 0 || fail "local forward path still listening"
rm -f $OBJ/unix-1.fwd
|| fail "connect to remote forwarded path failed"
${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \
|| fail "cancel remote forward failed"
-N=$(echo "" | nc -U $OBJ/unix-1.fwd 2>&1 | wc -l)
+N=$(echo "xyzzy" | nc -U $OBJ/unix-1.fwd 2>&1 | grep "xyzzy" | wc -l)
test ${N} -eq 0 || fail "remote forward path still listening"
rm -f $OBJ/unix-1.fwd