aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2000-04-06 06:21:44 +0800
committerwill <will@FreeBSD.org>2000-04-06 06:21:44 +0800
commitc418a110acbcdef5a7a1f525243eac827a86c68d (patch)
tree216778c73d42236779d464d479f031ff02635532 /security
parent16477f249e8b45bad7984aa8f9fe598809920be9 (diff)
downloadfreebsd-ports-gnome-c418a110acbcdef5a7a1f525243eac827a86c68d.tar.gz
freebsd-ports-gnome-c418a110acbcdef5a7a1f525243eac827a86c68d.tar.zst
freebsd-ports-gnome-c418a110acbcdef5a7a1f525243eac827a86c68d.zip
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)
Diffstat (limited to 'security')
-rw-r--r--security/ssh/Makefile4
-rw-r--r--security/ssh/files/sshd.sh27
-rw-r--r--security/ssh2/Makefile4
-rw-r--r--security/ssh2/files/sshd.sh27
4 files changed, 58 insertions, 4 deletions
diff --git a/security/ssh/Makefile b/security/ssh/Makefile
index 405a2e13bd50..e9c1640645cb 100644
--- a/security/ssh/Makefile
+++ b/security/ssh/Makefile
@@ -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
diff --git a/security/ssh/files/sshd.sh b/security/ssh/files/sshd.sh
new file mode 100644
index 000000000000..dd882003037c
--- /dev/null
+++ b/security/ssh/files/sshd.sh
@@ -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
diff --git a/security/ssh2/Makefile b/security/ssh2/Makefile
index 13bc11c98b9c..aed389b84676 100644
--- a/security/ssh2/Makefile
+++ b/security/ssh2/Makefile
@@ -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
diff --git a/security/ssh2/files/sshd.sh b/security/ssh2/files/sshd.sh
new file mode 100644
index 000000000000..dd882003037c
--- /dev/null
+++ b/security/ssh2/files/sshd.sh
@@ -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