2015-03-03 22:35:19 +00:00
|
|
|
# $OpenBSD: reconfigure.sh,v 1.5 2015/03/03 22:35:19 markus Exp $
|
2003-06-18 12:18:57 +00:00
|
|
|
# Placed in the Public Domain.
|
|
|
|
|
|
|
|
tid="simple connect after reconfigure"
|
|
|
|
|
|
|
|
# we need the full path to sshd for -HUP
|
2015-02-26 00:58:22 +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
|
2003-06-18 12:18:57 +00:00
|
|
|
|
|
|
|
start_sshd
|
|
|
|
|
2015-01-14 09:54:38 +00:00
|
|
|
trace "connect before restart"
|
2015-03-03 22:35:19 +00:00
|
|
|
for p in ${SSH_PROTOCOLS} ; do
|
2015-01-14 09:54:38 +00:00
|
|
|
${SSH} -o "Protocol=$p" -F $OBJ/ssh_config somehost true
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
fail "ssh connect with protocol $p failed before reconfigure"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2010-08-12 16:43:13 +00:00
|
|
|
PID=`$SUDO cat $PIDFILE`
|
2005-11-12 10:30:07 +00:00
|
|
|
rm -f $PIDFILE
|
|
|
|
$SUDO kill -HUP $PID
|
2003-06-18 12:18:57 +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-01-14 09:54:38 +00:00
|
|
|
trace "connect after restart"
|
2015-03-03 22:35:19 +00:00
|
|
|
for p in ${SSH_PROTOCOLS} ; do
|
2003-06-18 12:18:57 +00:00
|
|
|
${SSH} -o "Protocol=$p" -F $OBJ/ssh_config somehost true
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
fail "ssh connect with protocol $p failed after reconfigure"
|
|
|
|
fi
|
|
|
|
done
|