freebsd-dev/crypto/openssh/regress/reconfigure.sh

44 lines
855 B
Bash
Raw Normal View History

2018-05-06 12:24:45 +00:00
# $OpenBSD: reconfigure.sh,v 1.6 2017/04/30 23:34:55 djm Exp $
2004-01-07 11:10:17 +00:00
# Placed in the Public Domain.
tid="simple connect after reconfigure"
# we need the full path to sshd for -HUP
2015-07-02 13:15:34 +00:00
if test "x$USE_VALGRIND" = "x" ; then
case $SSHD in
/*)
# full path is OK
;;
*)
# otherwise make fully qualified
SSHD=$OBJ/$SSHD
esac
fi
2004-01-07 11:10:17 +00:00
start_sshd
2015-07-02 13:15:34 +00:00
trace "connect before restart"
2018-05-06 12:24:45 +00:00
${SSH} -F $OBJ/ssh_config somehost true
if [ $? -ne 0 ]; then
fail "ssh connect with failed before reconfigure"
fi
2015-07-02 13:15:34 +00:00
2010-11-08 10:45:44 +00:00
PID=`$SUDO cat $PIDFILE`
2006-03-22 19:46:12 +00:00
rm -f $PIDFILE
$SUDO kill -HUP $PID
2004-01-07 11:10:17 +00:00
trace "wait for sshd to restart"
i=0;
while [ ! -f $PIDFILE -a $i -lt 10 ]; do
i=`expr $i + 1`
sleep $i
done
test -f $PIDFILE || fatal "sshd did not restart"
2015-07-02 13:15:34 +00:00
trace "connect after restart"
2018-05-06 12:24:45 +00:00
${SSH} -F $OBJ/ssh_config somehost true
if [ $? -ne 0 ]; then
fail "ssh connect with failed after reconfigure"
fi