commit 77077ef07fedbd49841d4ffd8b910fa1ebf6df15 Author: Juergen Daubert <jue@jue.li> Date: Tue Feb 24 14:19:44 2015 +0100 Revert "openssh: improved rc script, drop rsa1 key creation" This reverts commit bf247a6f9eccf67b9934f0deb53ee9904425ba3d. diff --git a/openssh/.md5sum b/openssh/.md5sum index 3a71ac2..987423e 100644 --- a/openssh/.md5sum +++ b/openssh/.md5sum @@ -1,2 +1,2 @@ 3246aa79317b1d23cae783a3bf8275d6 openssh-6.7p1.tar.gz -8e480e229fe9ef6587fda62ea9424aa7 sshd +569e2757f9a1fcee7869c986b4c90fdd sshd diff --git a/openssh/Pkgfile b/openssh/Pkgfile index bb841b7..fe74784 100644 --- a/openssh/Pkgfile +++ b/openssh/Pkgfile @@ -5,7 +5,7 @@ name=openssh version=6.7p1 -release=2 +release=1 source=(ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$name-$version.tar.gz sshd) build() { diff --git a/openssh/sshd b/openssh/sshd index 7366bf8..57189a6 100755 --- a/openssh/sshd +++ b/openssh/sshd @@ -3,50 +3,40 @@ # /etc/rc.d/sshd: start/stop ssh daemon # -SSD=/sbin/start-stop-daemon -PROG=/usr/sbin/sshd -PID=/var/run/sshd.pid -KEYGEN=/usr/bin/ssh-keygen -SSHDIR=/etc/ssh - -create_keys() { - if [ ! -f $SSHDIR/ssh_host_rsa_key ]; then - $KEYGEN -q -t rsa -b 2048 -N "" -f $SSHDIR/ssh_host_rsa_key +case $1 in +start) + if [ ! -f /etc/ssh/ssh_host_key ]; then + /usr/bin/ssh-keygen -t rsa1 -N "" -f /etc/ssh/ssh_host_key > /dev/null fi - if [ ! -f $SSHDIR/ssh_host_dsa_key ]; then - $KEYGEN -q -t dsa -N "" -f $SSHDIR/ssh_host_dsa_key + if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then + /usr/bin/ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key > /dev/null fi - if [ ! -f $SSHDIR/ssh_host_ecdsa_key ]; then - $KEYGEN -q -t ecdsa -b 521 -N "" -f $SSHDIR/ssh_host_ecdsa_key + if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then + /usr/bin/ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key > /dev/null fi - if [ ! -f $SSHDIR/ssh_host_ed25519_key ]; then - $KEYGEN -q -t ed25519 -N "" -f $SSHDIR/ssh_host_ed25519_key + if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]; then + /usr/bin/ssh-keygen -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key > /dev/null fi -} - -case $1 in -start) - create_keys - $SSD --start --pidfile $PID --exec $PROG + if [ ! -f /etc/ssh/ssh_host_ed25519_key ]; then + /usr/bin/ssh-keygen -t ed25519 -N "" -f /etc/ssh/ssh_host_ed25519_key > /dev/null + fi + /usr/sbin/sshd ;; stop) - $SSD --stop --retry 10 --pidfile $PID + if [ -f /var/run/sshd.pid ]; then + kill $(< /var/run/sshd.pid) + rm -f /var/run/sshd.pid + else + killall -q /usr/sbin/sshd + fi ;; restart) $0 stop + sleep 2 $0 start ;; -status) - $SSD --status --pidfile $PID - case $? in - 0) echo "$PROG is running" ;; - 1) echo "$PROG is not running but the pid file $PID exists" ;; - 3) echo "$PROG is not running" ;; - 4) echo "Unable to determine the program status" ;; - esac - ;; *) - echo "usage: $0 [start|stop|restart|status]" + echo "usage: $0 [start|stop|restart]" ;; esac