geom_gate userland utility improvements
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
482 B

  1. #!/bin/sh -x
  2. # Written by Simon Josefsson
  3. # Start sshd, invoke parameters, saving exit code, kill sshd, and
  4. # return exit code.
  5. cmd="$@"
  6. SSHD=${SSHD:-/usr/sbin/sshd}
  7. $SSHD -f etc/sshd_config -h $PWD/etc/host -D &
  8. sshdpid=$!
  9. trap "kill ${sshdpid}; echo signal killing sshd; exit 1;" EXIT
  10. : "started sshd (${sshdpid})"
  11. sleep 1
  12. : Invoking $cmd...
  13. eval $cmd
  14. ec=$?
  15. : Self-test exit code $ec
  16. : "killing sshd (${sshdpid})"
  17. kill "${sshdpid}" > /dev/null 2>&1
  18. trap "" EXIT
  19. exit $ec