read -p "press enter to cleanup and remove tmp:"
echo "### stop sshd..."
- kill "$SSHD_PID"
+ kill %1
echo "### removing temp dir..."
rm -rf "$TEMPDIR"
+
+ wait
}
## setup trap
cp -a "$TESTDIR"/home/testuser "$TEMPDIR"/
cat <<EOF > "$TEMPDIR"/testuser/.ssh/config
-UserKnownHosts $TEMPDIR/testuser/.ssh/known_hosts
+UserKnownHostsFile $TEMPDIR/testuser/.ssh/known_hosts
EOF
cat <<EOF > "$TEMPDIR"/testuser/.monkeysphere/monkeysphere.conf
# launch test sshd with the new host key.
echo "### starting sshd..."
socat EXEC:"/usr/sbin/sshd -f ${SSHD_CONFIG} -i -d -d -d -D -e" "UNIX-LISTEN:${SOCKET}" 2> "$TEMPDIR"/sshd.log &
-export SSHD_PID=$!
-
### TESTUSER TESTS