diff options
author | jlam <jlam@pkgsrc.org> | 2000-07-24 16:44:52 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2000-07-24 16:44:52 +0000 |
commit | d6b3864d13e0d0a40dd820b82aef62d59def3340 (patch) | |
tree | dae7b5afaa8bab3ae23ce01c833a7661912e52dd /security | |
parent | a624e619884a767111d10cb35abfe80c9710108d (diff) | |
download | pkgsrc-d6b3864d13e0d0a40dd820b82aef62d59def3340.tar.gz |
Make all the installed /usr/pkg/etc/rc.d/sshd.sh files match.
Also default to "start" command if run with no arguments.
Diffstat (limited to 'security')
-rw-r--r-- | security/openssh/files/sshd.sh | 6 | ||||
-rw-r--r-- | security/ssh/files/sshd.sh | 56 | ||||
-rw-r--r-- | security/ssh6/files/sshd.sh | 56 |
3 files changed, 96 insertions, 22 deletions
diff --git a/security/openssh/files/sshd.sh b/security/openssh/files/sshd.sh index 8d23e616475..e2fd46678eb 100644 --- a/security/openssh/files/sshd.sh +++ b/security/openssh/files/sshd.sh @@ -1,12 +1,14 @@ #!/bin/sh # -# $NetBSD: sshd.sh,v 1.2 2000/07/22 08:22:02 jlam Exp $ +# $NetBSD: sshd.sh,v 1.3 2000/07/24 16:44:52 jlam Exp $ # name="sshd" pidfile="/var/run/${name}.pid" -case $1 in +command=${1:-start} + +case ${command} in start) if [ ! -f @SSH_CONF_DIR@/ssh_host_key ] then diff --git a/security/ssh/files/sshd.sh b/security/ssh/files/sshd.sh index 7f89964346e..da23c72b8bd 100644 --- a/security/ssh/files/sshd.sh +++ b/security/ssh/files/sshd.sh @@ -1,14 +1,50 @@ #!/bin/sh # -# $NetBSD: sshd.sh,v 1.2 1999/06/20 19:47:31 kim Exp $ +# $NetBSD: sshd.sh,v 1.3 2000/07/24 16:44:53 jlam Exp $ # -if [ ! -f @SSH_CONF_DIR@/ssh_host_key ] -then - @PREFIX@/bin/ssh-keygen -f @SSH_CONF_DIR@/ssh_host_key -N '' -fi -if [ -x @PREFIX@/sbin/sshd -a -f @SSH_CONF_DIR@/sshd_config ] -then - @PREFIX@/sbin/sshd - echo -n ' sshd' -fi + +name="sshd" +pidfile="/var/run/${name}.pid" + +command=${1:-start} + +case ${command} in +start) + if [ ! -f @SSH_CONF_DIR@/ssh_host_key ] + then + @PREFIX@/bin/ssh-keygen -b 1024 -N "" -f /etc/ssh_host_key + fi + if [ ! -f @SSH_CONF_DIR@/ssh_host_dsa_key ] + then + /usr/pkg/bin/ssh-keygen -d -N "" -f /etc/ssh_host_dsa_key + fi + if [ -x @PREFIX@/sbin/sshd -a -f @SSH_CONF_DIR@/sshd_config ] + then + echo "Starting ${name}." + @PREFIX@/sbin/sshd + fi + ;; +stop) + if [ -f ${pidfile} ]; then + pid=`head -1 ${pidfile}` + echo "Stopping ${name}." + kill -TERM ${pid} + else + echo "${name} not running?" + fi + ;; +restart) + ( $0 stop ) + sleep 1 + $0 start + ;; +status) + if [ -f ${pidfile} ]; then + pid=`head -1 ${pidfile}` + echo "${name} is running as pid ${pid}." + else + echo "${name} is not running." + fi + ;; +esac exit 0 diff --git a/security/ssh6/files/sshd.sh b/security/ssh6/files/sshd.sh index 71b70f624e4..b8beb89cc0d 100644 --- a/security/ssh6/files/sshd.sh +++ b/security/ssh6/files/sshd.sh @@ -1,14 +1,50 @@ #!/bin/sh # -# $NetBSD: sshd.sh,v 1.1 2000/03/20 02:25:32 itojun Exp $ +# $NetBSD: sshd.sh,v 1.2 2000/07/24 16:44:53 jlam Exp $ # -if [ ! -f @SSH_CONF_DIR@/ssh_host_key ] -then - @PREFIX@/bin/ssh-keygen -f @SSH_CONF_DIR@/ssh_host_key -N '' -fi -if [ -x @PREFIX@/sbin/sshd -a -f @SSH_CONF_DIR@/sshd_config ] -then - @PREFIX@/sbin/sshd - echo -n ' sshd' -fi + +name="sshd" +pidfile="/var/run/${name}.pid" + +command=${1:-start} + +case ${command} in +start) + if [ ! -f @SSH_CONF_DIR@/ssh_host_key ] + then + @PREFIX@/bin/ssh-keygen -b 1024 -N "" -f /etc/ssh_host_key + fi + if [ ! -f @SSH_CONF_DIR@/ssh_host_dsa_key ] + then + /usr/pkg/bin/ssh-keygen -d -N "" -f /etc/ssh_host_dsa_key + fi + if [ -x @PREFIX@/sbin/sshd -a -f @SSH_CONF_DIR@/sshd_config ] + then + echo "Starting ${name}." + @PREFIX@/sbin/sshd + fi + ;; +stop) + if [ -f ${pidfile} ]; then + pid=`head -1 ${pidfile}` + echo "Stopping ${name}." + kill -TERM ${pid} + else + echo "${name} not running?" + fi + ;; +restart) + ( $0 stop ) + sleep 1 + $0 start + ;; +status) + if [ -f ${pidfile} ]; then + pid=`head -1 ${pidfile}` + echo "${name} is running as pid ${pid}." + else + echo "${name} is not running." + fi + ;; +esac exit 0 |