2017-04-30 23:34:55 +00:00
|
|
|
# $OpenBSD: reconfigure.sh,v 1.6 2017/04/30 23:34:55 djm 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"
|
2017-04-30 23:34:55 +00:00
|
|
|
${SSH} -F $OBJ/ssh_config somehost true
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
fail "ssh connect with failed before reconfigure"
|
|
|
|
fi
|
2015-01-14 09:54:38 +00:00
|
|
|
|
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"
|
2017-04-30 23:34:55 +00:00
|
|
|
${SSH} -F $OBJ/ssh_config somehost true
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
fail "ssh connect with failed after reconfigure"
|
|
|
|
fi
|