summaryrefslogtreecommitdiff
path: root/opensshd.init
diff options
context:
space:
mode:
Diffstat (limited to 'opensshd.init')
-rwxr-xr-xopensshd.init49
1 files changed, 49 insertions, 0 deletions
diff --git a/opensshd.init b/opensshd.init
new file mode 100755
index 000000000..4c9c806d0
--- /dev/null
+++ b/opensshd.init
@@ -0,0 +1,49 @@
1#!/bin/bash
2
3# Init file for OpenSSH server daemon
4#
5# chkconfig: 2345 55 25
6# description: OpenSSH server daemon
7#
8# processname: opensshd
9# config: /etc/openssh/ssh_host_key
10# config: /etc/openssh/ssh_host_key.pub
11# config: /etc/openssh/ssh_random_seed
12# config: /etc/openssh/sshd_config
13# pidfile: /var/run/opensshd.pid
14
15# source function library
16. /etc/rc.d/init.d/functions
17
18RETVAL=0
19
20case "$1" in
21 start)
22 echo -n "Starting opensshd: "
23 daemon /usr/sbin/opensshd
24 RETVAL=$?
25 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sshd
26 echo
27 ;;
28 stop)
29 echo -n "Shutting down opensshd: "
30 killproc sshd
31 RETVAL=$?
32 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sshd
33 echo
34 ;;
35 restart)
36 $0 stop
37 $0 start
38 RETVAL=$?
39 ;;
40 status)
41 status opensshd
42 RETVAL=$?
43 ;;
44 *)
45 echo "Usage: opensshd {start|stop|restart|status}"
46 exit 1
47esac
48
49exit $RETVAL