]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
Edited openssh script and renamed it.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 5 Apr 2009 20:09:00 +0000 (22:09 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 5 Apr 2009 20:09:00 +0000 (22:09 +0200)
lfs/openssh
src/initscripts/extras/openssh [new file with mode: 0644]
src/initscripts/extras/sshd [deleted file]
src/rootfiles/core/openssh

index 8f4c73acea295c7d6d98fb0a6138921a2516a6bc..39e1bc63ef0c6a8d7612615aa812723d83eaba9d 100644 (file)
@@ -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 (file)
index 0000000..f05b3cf
--- /dev/null
@@ -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 (file)
index c7a02f8..0000000
+++ /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
index 8490633902a67bf23cd9e996bf5a41b9aeb8b480..82fb614ad2c774a01b13c8f4702a76a38b4a1635 100644 (file)
@@ -1,4 +1,4 @@
-etc/init.d/sshd
+etc/init.d/openssh
 etc/pam.d/sshd
 etc/ssh
 etc/ssh/moduli