diff options
author | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-09-08 13:40:51 -0300 |
---|---|---|
committer | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-09-08 13:40:51 -0300 |
commit | 1eb44cdc16d2ce4e40d42cacea7456ad245994f1 (patch) | |
tree | 8fffd10c72c5c326bcc41cdbbafda13c0ec5b2b6 /core/openssh/sshd | |
parent | 69d3aee0c3f0bb876065264baccf86c13088dd01 (diff) | |
parent | 8cca36c97b57b8d0a7e5521647c02409eb94ade4 (diff) |
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts:
community/portaudio/PKGBUILD
extra/ettercap/PKGBUILD
extra/kdelibs/PKGBUILD
extra/qt/PKGBUILD
gnome-unstable/epiphany/PKGBUILD
gnome-unstable/gnome-shell/PKGBUILD
gnome-unstable/pulseaudio/PKGBUILD
gnome-unstable/vala/PKGBUILD
kde-unstable/kdebase-workspace/PKGBUILD
testing/xf86-video-glint/PKGBUILD
Diffstat (limited to 'core/openssh/sshd')
-rwxr-xr-x | core/openssh/sshd | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/core/openssh/sshd b/core/openssh/sshd index 2ee1091f0..1d68fb877 100755 --- a/core/openssh/sshd +++ b/core/openssh/sshd @@ -7,42 +7,39 @@ PIDFILE=/var/run/sshd.pid PID=$(cat $PIDFILE 2>/dev/null) if ! readlink -q /proc/$PID/exe | grep -q '^/usr/sbin/sshd'; then - PID= - rm $PIDFILE 2>/dev/null + PID= + rm $PIDFILE 2>/dev/null fi case "$1" in - start) - stat_busy "Starting Secure Shell Daemon" - [ -f /etc/ssh/ssh_host_key ] || { /usr/bin/ssh-keygen -t rsa1 -N "" -f /etc/ssh/ssh_host_key >/dev/null; } - [ -f /etc/ssh/ssh_host_rsa_key ] || { /usr/bin/ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key >/dev/null; } - [ -f /etc/ssh/ssh_host_dsa_key ] || { /usr/bin/ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key >/dev/null; } - [ -f /etc/ssh/ssh_host_ecdsa_key ] || { /usr/bin/ssh-keygen -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key >/dev/null; } - [ -d /var/empty ] || mkdir -p /var/empty - [ -z "$PID" ] && /usr/sbin/sshd $SSHD_ARGS - if [ $? -gt 0 ]; then - stat_fail - else - add_daemon sshd - stat_done - fi - ;; - stop) - stat_busy "Stopping Secure Shell Daemon" - [ ! -z "$PID" ] && kill $PID &> /dev/null - if [ $? -gt 0 ]; then - stat_fail - else - rm_daemon sshd - stat_done - fi - ;; - restart) - $0 stop - sleep 1 - $0 start - ;; - *) - echo "usage: $0 {start|stop|restart}" + start) + stat_busy 'Starting Secure Shell Daemon' + /usr/bin/ssh-keygen -A + [[ -d /var/empty ]] || mkdir -p /var/empty + [[ -z $PID ]] && /usr/sbin/sshd $SSHD_ARGS + if [[ $? -gt 0 ]]; then + stat_fail + else + add_daemon sshd + stat_done + fi + ;; + stop) + stat_busy 'Stopping Secure Shell Daemon' + [[ ! -z $PID ]] && kill $PID &> /dev/null + if [[ $? -gt 0 ]]; then + stat_fail + else + rm_daemon sshd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" esac exit 0 |