]>
Commit | Line | Data |
---|---|---|
cf3b46d6 AF |
1 | #!/bin/sh |
2 | # | |
3 | # sshd sshd (secure shell daemon) | |
4 | # | |
5 | # chkconfig: 345 55 45 | |
6 | # | |
7 | # description: sshd (secure shell daemon) is a server part of the ssh suite. | |
8 | # Ssh can be used for remote login, remote file copying, TCP port | |
9 | # forwarding etc. Ssh offers strong encryption and authentication. | |
10 | ||
11 | ||
12 | # Source function library | |
13 | . /etc/rc.d/init.d/functions | |
14 | ||
15 | # Get network config | |
16 | . /etc/sysconfig/network | |
17 | ||
18 | # Get service config | |
19 | [ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd | |
20 | ||
21 | # Check that networking is up. | |
22 | if [ "${NETWORKING}" = "no" ]; then | |
23 | echo "WARNING: Networking is down. Sshd can't be runed." | |
24 | exit 1 | |
25 | fi | |
26 | ||
27 | ||
28 | # See how we were called. | |
29 | case "$1" in | |
30 | start) | |
31 | # Check if the service is already running? | |
32 | if [ ! -f /var/lock/subsys/sshd ]; then | |
33 | show Starting OpenSSHd | |
34 | daemon sshd -h /etc/ssh/ssh_host_key | |
35 | else | |
36 | echo "OpenSSHd already is running" | |
37 | fi | |
38 | touch /var/lock/subsys/sshd | |
39 | ;; | |
40 | stop) | |
41 | show Stopping sshd | |
42 | killproc sshd | |
43 | rm -f /var/run/sshd.pid | |
44 | rm -f /var/lock/subsys/sshd | |
45 | ;; | |
46 | restart|reload) | |
47 | $0 stop | |
48 | $0 start | |
49 | ;; | |
50 | status) | |
51 | status sshd | |
52 | ;; | |
53 | *) | |
54 | echo "Usage: $0 {start|stop|status|restart|reload}" | |
55 | exit 1 | |
56 | esac | |
57 | ||
58 | exit 0 | |
59 |