File: lshd.rhlinux.init

package info (click to toggle)
lsh-utils 2.0.4-dfsg-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 15,552 kB
  • ctags: 7,007
  • sloc: ansic: 68,120; sh: 5,964; asm: 1,221; makefile: 744; lisp: 656; perl: 55
file content (63 lines) | stat: -rw-r--r-- 1,365 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
#
# Version 0.1
#
# chkconfig: 345 40 60
# description: provides secure connections through untrusted networks
# lsh is based on the specification for ssh2 and should (eventually)
# be compatible.
#
# processname: lshd
#

# Source function library.
. /etc/rc.d/init.d/functions

PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH

if [ ! -x /usr/sbin/lshd -o \
        ! -f /etc/lsh_host_key -o \
        ! -f /etc/lsh_host_key.pub ]
then
        cat 1>&2 <<EOF!
                ERROR: lsh is not installed properly
                check the existence of these files:
                /usr/sbin/lshd
		/etc/lsh_host_key
		/etc/lsh_host_key.pub
		 
EOF!
        exit 1
fi

case "$1" in
        start)
                echo -n "Starting lshd secure connection service: "
                daemon lshd --daemonic
                touch /var/lock/subsys/lshd
                echo
                ;;

        stop)
                echo -n "Stopping lshd secure connection service:"
                killproc lshd
                rm -f /var/lock/subsys/lshd
                echo
                ;;

        status)
                status lshd
                ;;

        restart|reload)
                $0 stop
                $0 start
                ;;

        *)
                echo "Usage: $0 {start|stop|restart|reload|status}"
                exit 1
esac

exit 0