1#	$OpenBSD: reconfigure.sh,v 1.6 2017/04/30 23:34:55 djm Exp $
2#	Placed in the Public Domain.
3
4tid="simple connect after reconfigure"
5
6# we need the full path to sshd for -HUP
7if test "x$USE_VALGRIND" = "x" ; then
8	case $SSHD in
9	/*)
10		# full path is OK
11		;;
12	*)
13		# otherwise make fully qualified
14		SSHD=$OBJ/$SSHD
15	esac
16fi
17
18start_sshd
19
20trace "connect before restart"
21${SSH} -F $OBJ/ssh_config somehost true
22if [ $? -ne 0 ]; then
23	fail "ssh connect with failed before reconfigure"
24fi
25
26PID=`$SUDO cat $PIDFILE`
27rm -f $PIDFILE
28$SUDO kill -HUP $PID
29
30trace "wait for sshd to restart"
31i=0;
32while [ ! -f $PIDFILE -a $i -lt 10 ]; do
33	i=`expr $i + 1`
34	sleep $i
35done
36
37test -f $PIDFILE || fatal "sshd did not restart"
38
39trace "connect after restart"
40${SSH} -F $OBJ/ssh_config somehost true
41if [ $? -ne 0 ]; then
42	fail "ssh connect with failed after reconfigure"
43fi
44