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:
parent
b11c4333de
commit
810b23015a
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=27351
@ -108,8 +108,8 @@ post-install:
|
|||||||
fi
|
fi
|
||||||
@if [ ! -f ${PREFIX}/etc/rc.d/sshd.sh ]; then \
|
@if [ ! -f ${PREFIX}/etc/rc.d/sshd.sh ]; then \
|
||||||
${ECHO} "Installing ${PREFIX}/etc/rc.d/sshd.sh startup file."; \
|
${ECHO} "Installing ${PREFIX}/etc/rc.d/sshd.sh startup file."; \
|
||||||
${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/sshd.sh; \
|
${SED} -e 's+!!PREFIX!!+${PREFIX}+g' ${FILESDIR}/sshd.sh \
|
||||||
${ECHO} "[ -x ${PREFIX}/sbin/sshd ] && ${PREFIX}/sbin/sshd && ${ECHO} -n ' sshd'" >> ${PREFIX}/etc/rc.d/sshd.sh; \
|
> ${PREFIX}/etc/rc.d/sshd.sh \
|
||||||
${CHMOD} 751 ${PREFIX}/etc/rc.d/sshd.sh; \
|
${CHMOD} 751 ${PREFIX}/etc/rc.d/sshd.sh; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
27
security/ssh/files/sshd.sh
Normal file
27
security/ssh/files/sshd.sh
Normal 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
|
@ -101,8 +101,8 @@ post-install:
|
|||||||
#
|
#
|
||||||
@if [ ! -f ${PREFIX}/etc/rc.d/sshd.sh ]; then \
|
@if [ ! -f ${PREFIX}/etc/rc.d/sshd.sh ]; then \
|
||||||
${ECHO} "Installing ${PREFIX}/etc/rc.d/sshd.sh startup file."; \
|
${ECHO} "Installing ${PREFIX}/etc/rc.d/sshd.sh startup file."; \
|
||||||
${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/sshd.sh; \
|
${SED} -e 's+!!PREFIX!!+${PREFIX}+' < ${FILESDIR}/sshd.sh \
|
||||||
${ECHO} "[ -x ${PREFIX}/sbin/sshd ] && ${PREFIX}/sbin/sshd && ${ECHO} -n ' sshd'" >> ${PREFIX}/etc/rc.d/sshd.sh; \
|
> ${PREFIX}/etc/rc.d/sshd.sh
|
||||||
${CHMOD} 751 ${PREFIX}/etc/rc.d/sshd.sh; \
|
${CHMOD} 751 ${PREFIX}/etc/rc.d/sshd.sh; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
27
security/ssh2/files/sshd.sh
Normal file
27
security/ssh2/files/sshd.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user