1# $OpenBSD: reconfigure.sh,v 1.5 2015/03/03 22:35:19 markus Exp $ 2# Placed in the Public Domain. 3 4tid="simple connect after reconfigure" 5 6# we need the full path to sshd for -HUP 7start_sshd 8 9trace "connect before restart" 10for p in ${SSH_PROTOCOLS} ; do 11 ${SSH} -o "Protocol=$p" -F $OBJ/ssh_config somehost true 12 if [ $? -ne 0 ]; then 13 fail "ssh connect with protocol $p failed before reconfigure" 14 fi 15done 16 17$SUDO kill -HUP `cat $PIDFILE` 18sleep 1 19 20trace "wait for sshd to restart" 21i=0; 22while [ ! -f $PIDFILE -a $i -lt 10 ]; do 23 i=`expr $i + 1` 24 sleep $i 25done 26 27test -f $PIDFILE || fatal "sshd did not restart" 28 29trace "connect after restart" 30for p in ${SSH_PROTOCOLS} ; do 31 ${SSH} -o "Protocol=$p" -F $OBJ/ssh_config somehost true 32 if [ $? -ne 0 ]; then 33 fail "ssh connect with protocol $p failed after reconfigure" 34 fi 35done 36