1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-24 21:01:20 +00:00
freebsd-ports/security/ssh/files/sshd.sh
Will Andrews 810b23015a Add better sshd startup scripts; specifically, allow restarting and
stopping the server.

Martti's submission did not include -h, which I added because if I had
added the scripts the way he submitted them, the server wouldn't be
started on startup.

PR:		10196
Submitted by:	Martti Kuparinen <martti.kuparinen@ericsson.com>
Reviewed by:	kris (partially)
No response:	maintainers (PR opened February 22, 1999)
2000-04-05 22:21:44 +00:00

28 lines
454 B
Bash

#!/bin/sh
case "$1" in
start)
!!PREFIX!!/sbin/sshd
echo -n ' sshd'
;;
stop)
if [ -f /var/run/sshd.pid ]; then
kill -TERM `cat /var/run/sshd.pid`
rm -f /var/run/sshd.pid
echo -n ' sshd'
fi
;;
restart)
if [ -f /var/run/sshd.pid ]; then
kill -HUP `cat /var/run/sshd.pid`
echo 'sshd restarted'
fi
;;
-h)
echo "Usage: `basename $0` { start | stop | restart }"
;;
*)
!!PREFIX!!/sbin/sshd
echo -n ' sshd'
;;
esac