updated on Fri Jan 20 12:03:34 UTC 2012
[aur-mirror.git] / openssh-mit-krb5 / sshd
blob1697e6664f6b319c5953aa4148682e2dba6ff647
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 . /etc/conf.d/sshd
7 PID=`cat /var/run/sshd.pid 2>/dev/null`
8 case "$1" in
9 start)
10 stat_busy "Starting Secure Shell Daemon"
11 [ -f /etc/ssh/ssh_host_key ] || { /usr/bin/ssh-keygen -t rsa1 -N "" -f /etc/ssh/ssh_host_key >/dev/null; }
12 [ -f /etc/ssh/ssh_host_rsa_key ] || { /usr/bin/ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key >/dev/null; }
13 [ -f /etc/ssh/ssh_host_dsa_key ] || { /usr/bin/ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key >/dev/null; }
14 [ -d /var/empty ] || mkdir -p /var/empty
15 [ -z "$PID" ] && /usr/sbin/sshd $SSHD_ARGS
16 if [ $? -gt 0 ]; then
17 stat_fail
18 else
19 add_daemon sshd
20 stat_done
23 stop)
24 stat_busy "Stopping Secure Shell Daemon"
25 [ ! -z "$PID" ] && kill $PID &> /dev/null
26 if [ $? -gt 0 ]; then
27 stat_fail
28 else
29 rm_daemon sshd
30 stat_done
33 restart)
34 $0 stop
35 sleep 1
36 $0 start
39 echo "usage: $0 {start|stop|restart}"
40 esac
41 exit 0