diff options
| author | Andrei Dinu <andrei.adrianx.dinu@intel.com> | 2013-06-07 14:35:28 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-11 15:38:02 +0100 |
| commit | 55316357e39b1abf1cfa4c935bfc53cf317f37ec (patch) | |
| tree | 9fa59e59741548547933be32216c8d44e03683e0 /meta/recipes-connectivity/openssh/openssh-6.2p2/init | |
| parent | 242d5fb6db45de0719496d73d1c11e147f9c2fba (diff) | |
| download | poky-55316357e39b1abf1cfa4c935bfc53cf317f37ec.tar.gz | |
openssh : upgrade to 6.2p2
upgrade from 6.2p1 -> 6.2p2
(From OE-Core rev: 752ad432a248befe7d7b1dd799209f7bcbe9231e)
Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/openssh/openssh-6.2p2/init')
| -rw-r--r-- | meta/recipes-connectivity/openssh/openssh-6.2p2/init | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh-6.2p2/init b/meta/recipes-connectivity/openssh/openssh-6.2p2/init new file mode 100644 index 0000000000..cde52ef3f4 --- /dev/null +++ b/meta/recipes-connectivity/openssh/openssh-6.2p2/init | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | #! /bin/sh | ||
| 2 | set -e | ||
| 3 | |||
| 4 | # /etc/init.d/ssh: start and stop the OpenBSD "secure shell" daemon | ||
| 5 | |||
| 6 | test -x /usr/sbin/sshd || exit 0 | ||
| 7 | ( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0 | ||
| 8 | |||
| 9 | if test -f /etc/default/ssh; then | ||
| 10 | . /etc/default/ssh | ||
| 11 | fi | ||
| 12 | |||
| 13 | check_for_no_start() { | ||
| 14 | # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists | ||
| 15 | if [ -e /etc/ssh/sshd_not_to_be_run ]; then | ||
| 16 | echo "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" | ||
| 17 | exit 0 | ||
| 18 | fi | ||
| 19 | } | ||
| 20 | |||
| 21 | check_privsep_dir() { | ||
| 22 | # Create the PrivSep empty dir if necessary | ||
| 23 | if [ ! -d /var/run/sshd ]; then | ||
| 24 | mkdir /var/run/sshd | ||
| 25 | chmod 0755 /var/run/sshd | ||
| 26 | fi | ||
| 27 | } | ||
| 28 | |||
| 29 | check_config() { | ||
| 30 | /usr/sbin/sshd -t || exit 1 | ||
| 31 | } | ||
| 32 | |||
| 33 | check_keys() { | ||
| 34 | # create keys if necessary | ||
| 35 | if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then | ||
| 36 | echo " generating ssh RSA key..." | ||
| 37 | ssh-keygen -q -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa | ||
| 38 | fi | ||
| 39 | if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]; then | ||
| 40 | echo " generating ssh ECDSA key..." | ||
| 41 | ssh-keygen -q -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa | ||
| 42 | fi | ||
| 43 | if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then | ||
| 44 | echo " generating ssh DSA key..." | ||
| 45 | ssh-keygen -q -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa | ||
| 46 | fi | ||
| 47 | } | ||
| 48 | |||
| 49 | export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" | ||
| 50 | |||
| 51 | case "$1" in | ||
| 52 | start) | ||
| 53 | check_for_no_start | ||
| 54 | echo "Starting OpenBSD Secure Shell server: sshd" | ||
| 55 | check_keys | ||
| 56 | check_privsep_dir | ||
| 57 | start-stop-daemon -S -x /usr/sbin/sshd -- $SSHD_OPTS | ||
| 58 | echo "done." | ||
| 59 | ;; | ||
| 60 | stop) | ||
| 61 | echo -n "Stopping OpenBSD Secure Shell server: sshd" | ||
| 62 | start-stop-daemon -K -x /usr/sbin/sshd | ||
| 63 | echo "." | ||
| 64 | ;; | ||
| 65 | |||
| 66 | reload|force-reload) | ||
| 67 | check_for_no_start | ||
| 68 | check_keys | ||
| 69 | check_config | ||
| 70 | echo -n "Reloading OpenBSD Secure Shell server's configuration" | ||
| 71 | start-stop-daemon -K -s 1 -x /usr/sbin/sshd | ||
| 72 | echo "." | ||
| 73 | ;; | ||
| 74 | |||
| 75 | restart) | ||
| 76 | check_keys | ||
| 77 | check_config | ||
| 78 | echo -n "Restarting OpenBSD Secure Shell server: sshd" | ||
| 79 | start-stop-daemon -K -oknodo -x /usr/sbin/sshd | ||
| 80 | check_for_no_start | ||
| 81 | check_privsep_dir | ||
| 82 | sleep 2 | ||
| 83 | start-stop-daemon -S -x /usr/sbin/sshd -- $SSHD_OPTS | ||
| 84 | echo "." | ||
| 85 | ;; | ||
| 86 | |||
| 87 | *) | ||
| 88 | echo "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart}" | ||
| 89 | exit 1 | ||
| 90 | esac | ||
| 91 | |||
| 92 | exit 0 | ||
