diff options
author | Scott Garman <scott.a.garman@intel.com> | 2012-05-07 15:49:13 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-08 14:00:07 +0100 |
commit | ce1fc60b0044bccf6cf8432700d6c0b6f042dae2 (patch) | |
tree | 7999601a07d1dee117a6f228f2e2fad4aefc58b2 /meta/recipes-connectivity/openssh/openssh-6.0p1/init | |
parent | 977ba301a1063a84b865ddf7367c35827fbffc86 (diff) | |
download | openembedded-core-ce1fc60b0044bccf6cf8432700d6c0b6f042dae2.tar.gz openembedded-core-ce1fc60b0044bccf6cf8432700d6c0b6f042dae2.tar.bz2 openembedded-core-ce1fc60b0044bccf6cf8432700d6c0b6f042dae2.zip |
openssh: upgrade to 6.0p1
LICENSE checksum changed due to a trivial difference in the credits
list.
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/openssh/openssh-6.0p1/init')
-rw-r--r-- | meta/recipes-connectivity/openssh/openssh-6.0p1/init | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh-6.0p1/init b/meta/recipes-connectivity/openssh/openssh-6.0p1/init new file mode 100644 index 0000000000..055dd22e1b --- /dev/null +++ b/meta/recipes-connectivity/openssh/openssh-6.0p1/init @@ -0,0 +1,92 @@ +#! /bin/sh +set -e + +# /etc/init.d/ssh: start and stop the OpenBSD "secure shell" daemon + +test -x /usr/sbin/sshd || exit 0 +( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0 + +if test -f /etc/default/ssh; then + . /etc/default/ssh +fi + +check_for_no_start() { + # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists + if [ -e /etc/ssh/sshd_not_to_be_run ]; then + echo "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" + exit 0 + fi +} + +check_privsep_dir() { + # Create the PrivSep empty dir if necessary + if [ ! -d /var/run/sshd ]; then + mkdir /var/run/sshd + chmod 0755 /var/run/sshd + fi +} + +check_config() { + /usr/sbin/sshd -t || exit 1 +} + +check_keys() { + # create keys if necessary + if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then + echo " generating ssh RSA key..." + ssh-keygen -q -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa + fi + if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]; then + echo " generating ssh ECDSA key..." + ssh-keygen -q -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa + fi + if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then + echo " generating ssh DSA key..." + ssh-keygen -q -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa + fi +} + +export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" + +case "$1" in + start) + check_for_no_start + echo "Starting OpenBSD Secure Shell server: sshd" + check_keys + check_privsep_dir + start-stop-daemon -S -x /usr/sbin/sshd -- $SSHD_OPTS + echo "done." + ;; + stop) + echo -n "Stopping OpenBSD Secure Shell server: sshd" + start-stop-daemon -K -x /usr/sbin/sshd + echo "." + ;; + + reload|force-reload) + check_for_no_start + check_keys + check_config + echo -n "Reloading OpenBSD Secure Shell server's configuration" + start-stop-daemon -K -s 1 -x /usr/sbin/sshd + echo "." + ;; + + restart) + check_keys + check_config + echo -n "Restarting OpenBSD Secure Shell server: sshd" + start-stop-daemon -K -x /usr/sbin/sshd + check_for_no_start + check_privsep_dir + sleep 2 + start-stop-daemon -S -x /usr/sbin/sshd -- $SSHD_OPTS + echo "." + ;; + + *) + echo "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart}" + exit 1 +esac + +exit 0 |