Darren Tucker | e0194e5 | 2003-06-22 12:33:27 +1000 | [diff] [blame] | 1 | # $OpenBSD: reconfigure.sh,v 1.2 2003/06/21 09:14:05 markus Exp $ |
Darren Tucker | fc8a7ea | 2003-06-18 22:18:57 +1000 | [diff] [blame] | 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="simple connect after reconfigure" |
| 5 | |
| 6 | # we need the full path to sshd for -HUP |
Darren Tucker | 871f740 | 2003-09-04 13:59:48 +1000 | [diff] [blame] | 7 | case $SSHD in |
| 8 | /*) |
| 9 | # full path is OK |
| 10 | ;; |
| 11 | *) |
| 12 | # otherwise make fully qualified |
| 13 | SSHD=$OBJ/$SSHD |
| 14 | esac |
Darren Tucker | fc8a7ea | 2003-06-18 22:18:57 +1000 | [diff] [blame] | 15 | |
| 16 | start_sshd |
| 17 | |
Darren Tucker | cb6ecde | 2005-11-12 21:30:07 +1100 | [diff] [blame] | 18 | PID=`cat $PIDFILE` |
| 19 | rm -f $PIDFILE |
| 20 | $SUDO kill -HUP $PID |
Darren Tucker | fc8a7ea | 2003-06-18 22:18:57 +1000 | [diff] [blame] | 21 | |
| 22 | trace "wait for sshd to restart" |
| 23 | i=0; |
| 24 | while [ ! -f $PIDFILE -a $i -lt 10 ]; do |
| 25 | i=`expr $i + 1` |
| 26 | sleep $i |
| 27 | done |
| 28 | |
| 29 | test -f $PIDFILE || fatal "sshd did not restart" |
| 30 | |
| 31 | for p in 1 2; do |
| 32 | ${SSH} -o "Protocol=$p" -F $OBJ/ssh_config somehost true |
| 33 | if [ $? -ne 0 ]; then |
| 34 | fail "ssh connect with protocol $p failed after reconfigure" |
| 35 | fi |
| 36 | done |