From: Michael Tremer Date: Sun, 5 Apr 2009 20:09:00 +0000 (+0200) Subject: Edited openssh script and renamed it. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13d1a66e095b844bff15e7aa3846e4a2e2916e30;p=ipfire-3.x.git Edited openssh script and renamed it. --- diff --git a/lfs/openssh b/lfs/openssh index 8f4c73ace..39e1bc63e 100644 --- a/lfs/openssh +++ b/lfs/openssh @@ -35,8 +35,6 @@ DEPS = openssl pam OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP) -INITSCRIPT = sshd - ############################################################################### # Top-level Rules ############################################################################### diff --git a/src/initscripts/extras/openssh b/src/initscripts/extras/openssh new file mode 100644 index 000000000..f05b3cf5a --- /dev/null +++ b/src/initscripts/extras/openssh @@ -0,0 +1,63 @@ +#!/bin/sh +# Begin /etc/init.d/openssh + +### BEGIN INIT INFO +# Provides: ssh +# Required-Start: $network +# Should-Start: +# Required-Stop: +# Should-Stop: netfs +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Starts OpenSSH daemon. +# Description: Starts OpenSSH daemon. +### END INIT INFO + +. /lib/lsb/init-functions + +MESSAGE="OpenSSH Server" +BIN_FILE="/usr/sbin/sshd" + +function generate_keys() { + for algo in dsa rsa; do + [ -e "/etc/ssh/ssh_host_${algo}_key" ] && continue + ssh-keygen -q -t ${algo} -N "" /etc/ssh/ssh_host_${algo}_key + done +} + +case "$1" in + start) + generate_keys + start_daemon "${BIN_FILE}" + evaluate_retval start + ;; + + stop) + killproc "${BIN_FILE}" + evaluate_retval stop + ;; + + reload) + killproc "${BIN_FILE}" -HUP + evaluate_retval reload + ;; + + restart) + killproc "${BIN_FILE}" + sleep 1 + start_daemon "${BIN_FILE}" + evaluate_retval restart + ;; + + status) + statusproc "${BIN_FILE}" + ;; + + *) + echo "Usage: $0 {start|stop|reload|restart|status}" + exit 1 + ;; + +esac + +# End $rc_base/init.d/openssh diff --git a/src/initscripts/extras/sshd b/src/initscripts/extras/sshd deleted file mode 100644 index c7a02f85a..000000000 --- a/src/initscripts/extras/sshd +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# Begin /etc/init.d/sshd - -. /lib/lsb/init-functions - -MESSAGE="SSH Server" -BIN_FILE="/usr/sbin/sshd" - -chk_stat - -case "$1" in - start) - start_daemon "${BIN_FILE}" - evaluate_retval start - ;; - - stop) - killproc "${BIN_FILE}" - evaluate_retval stop - ;; - - reload) - killproc "${BIN_FILE}" -HUP - evaluate_retval reload - ;; - - restart) - killproc "$BIN_FILE" - sleep 1 - start_daemon "${BIN_FILE}" - evaluate_retval restart - ;; - - status) - statusproc "${BIN_FILE}" - ;; - - *) - echo "Usage: $0 {start|stop|reload|restart|status}" - exit 1 - ;; -esac - -# End /etc/init.d/sshd diff --git a/src/rootfiles/core/openssh b/src/rootfiles/core/openssh index 849063390..82fb614ad 100644 --- a/src/rootfiles/core/openssh +++ b/src/rootfiles/core/openssh @@ -1,4 +1,4 @@ -etc/init.d/sshd +etc/init.d/openssh etc/pam.d/sshd etc/ssh etc/ssh/moduli