blob: 40cc92b86994dea082704039198e3a810959061d [file] [log] [blame]
Damien Miller06230761999-10-28 14:03:14 +10001#!/bin/bash
2
3# Init file for OpenSSH server daemon
4#
5# chkconfig: 2345 55 25
6# description: OpenSSH server daemon
7#
Damien Millera37010e1999-10-29 09:18:29 +10008# processname: sshd
9# config: /etc/ssh/ssh_host_key
10# config: /etc/ssh/ssh_host_key.pub
11# config: /etc/ssh/ssh_random_seed
12# config: /etc/ssh/sshd_config
13# pidfile: /var/run/sshd.pid
Damien Miller06230761999-10-28 14:03:14 +100014
15# source function library
16. /etc/rc.d/init.d/functions
17
18RETVAL=0
19
20case "$1" in
21 start)
Damien Millera37010e1999-10-29 09:18:29 +100022 echo -n "Starting sshd: "
23 daemon /usr/sbin/sshd
Damien Miller06230761999-10-28 14:03:14 +100024 RETVAL=$?
25 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sshd
26 echo
27 ;;
28 stop)
Damien Millera37010e1999-10-29 09:18:29 +100029 echo -n "Shutting down sshd: "
Damien Miller06230761999-10-28 14:03:14 +100030 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)
Damien Millera37010e1999-10-29 09:18:29 +100041 status sshd
Damien Miller06230761999-10-28 14:03:14 +100042 RETVAL=$?
43 ;;
44 *)
Damien Millera37010e1999-10-29 09:18:29 +100045 echo "Usage: sshd {start|stop|restart|status}"
Damien Miller06230761999-10-28 14:03:14 +100046 exit 1
47esac
48
49exit $RETVAL