reconfigure.sh 867 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # $OpenBSD: reconfigure.sh,v 1.6 2017/04/30 23:34:55 djm Exp $
  2. # Placed in the Public Domain.
  3. tid="simple connect after reconfigure"
  4. # we need the full path to sshd for -HUP
  5. if test "x$USE_VALGRIND" = "x"; then
  6. case $SSHD in
  7. /*)
  8. # full path is OK
  9. ;;
  10. *)
  11. # otherwise make fully qualified
  12. SSHD=$OBJ/$SSHD
  13. ;;
  14. esac
  15. fi
  16. start_sshd
  17. trace "connect before restart"
  18. ${SSH} -F $OBJ/ssh_config somehost true
  19. if [ $? -ne 0 ]; then
  20. fail "ssh connect with failed before reconfigure"
  21. fi
  22. PID=$($SUDO cat $PIDFILE)
  23. rm -f $PIDFILE
  24. $SUDO kill -HUP $PID
  25. trace "wait for sshd to restart"
  26. i=0
  27. while [ ! -f $PIDFILE -a $i -lt 10 ]; do
  28. i=$(expr $i + 1)
  29. sleep $i
  30. done
  31. test -f $PIDFILE || fatal "sshd did not restart"
  32. trace "connect after restart"
  33. ${SSH} -F $OBJ/ssh_config somehost true
  34. if [ $? -ne 0 ]; then
  35. fail "ssh connect with failed after reconfigure"
  36. fi