1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

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)
This commit is contained in:
Will Andrews 2000-04-05 22:21:44 +00:00
parent b11c4333de
commit 810b23015a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=27351
4 changed files with 58 additions and 4 deletions

View File

@ -108,8 +108,8 @@ post-install:
fi
@if [ ! -f ${PREFIX}/etc/rc.d/sshd.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/sshd.sh startup file."; \
${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/sshd.sh; \
${ECHO} "[ -x ${PREFIX}/sbin/sshd ] && ${PREFIX}/sbin/sshd && ${ECHO} -n ' sshd'" >> ${PREFIX}/etc/rc.d/sshd.sh; \
${SED} -e 's+!!PREFIX!!+${PREFIX}+g' ${FILESDIR}/sshd.sh \
> ${PREFIX}/etc/rc.d/sshd.sh \
${CHMOD} 751 ${PREFIX}/etc/rc.d/sshd.sh; \
fi

View File

@ -0,0 +1,27 @@
#!/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

View File

@ -101,8 +101,8 @@ post-install:
#
@if [ ! -f ${PREFIX}/etc/rc.d/sshd.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/sshd.sh startup file."; \
${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/sshd.sh; \
${ECHO} "[ -x ${PREFIX}/sbin/sshd ] && ${PREFIX}/sbin/sshd && ${ECHO} -n ' sshd'" >> ${PREFIX}/etc/rc.d/sshd.sh; \
${SED} -e 's+!!PREFIX!!+${PREFIX}+' < ${FILESDIR}/sshd.sh \
> ${PREFIX}/etc/rc.d/sshd.sh
${CHMOD} 751 ${PREFIX}/etc/rc.d/sshd.sh; \
fi

View File

@ -0,0 +1,27 @@
#!/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