]>
Commit | Line | Data |
---|---|---|
80a001eb | 1 | #!/bin/sh |
2 | # | |
3 | # bjorb Bjorb - secure TCP relay software | |
4 | # | |
5 | # chkconfig: 345 14 91 | |
6 | # | |
7 | # description: Bjorb is secure TCP relay software. Bjorb provides you, secure \ | |
8 | # end-to-end connection over insecure network such as Internet.\ | |
9 | # Features:\ | |
10 | # 1. Encrypt/decrypt any "static port" TCP connection with SSL.\ | |
11 | # 2. Restrcit access by IP address.\ | |
12 | # 3. Server side certification.\ | |
13 | # 4. Client side certification.\ | |
14 | # | |
15 | # pidfile: /var/run/bjorb.pid | |
16 | ||
17 | # Source function library | |
18 | . /etc/rc.d/init.d/functions | |
19 | ||
20 | # Get network config | |
21 | . /etc/sysconfig/network | |
22 | ||
23 | # Get service config - may override defaults | |
24 | [ -f /etc/sysconfig/bjorb ] && . /etc/sysconfig/bjorb | |
25 | ||
26 | # Check that networking is up. | |
27 | if is_yes "${NETWORKING}"; then | |
28 | if [ ! -f /var/lock/subsys/network ]; then | |
80a001eb | 29 | msg_network_down bjorb |
30 | exit 1 | |
31 | fi | |
32 | else | |
33 | exit 0 | |
34 | fi | |
35 | ||
36 | ||
37 | # See how we were called. | |
38 | case "$1" in | |
39 | start) | |
40 | # Check if the service is already running? | |
41 | if [ ! -f /var/lock/subsys/bjorb ]; then | |
80a001eb | 42 | msg_starting Bjorb |
43 | daemon bjorb -D | |
44 | RETVAL=$? | |
45 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bjorb | |
46 | else | |
80a001eb | 47 | msg_already_running Bjorb |
48 | fi | |
49 | ;; | |
50 | stop) | |
51 | if [ -f /var/lock/subsys/bjorb ]; then | |
52 | # Stop daemons. | |
80a001eb | 53 | msg_stopping Bjorb |
54 | killproc bjorb | |
55 | rm -f /var/lock/subsys/bjorb | |
56 | else | |
80a001eb | 57 | msg_not_running Bjorb |
58 | fi | |
59 | ;; | |
60 | restart) | |
61 | $0 stop | |
62 | $0 start | |
63 | exit $? | |
64 | ;; | |
65 | reload) | |
66 | if [ -f /var/lock/subsys/bjorb ]; then | |
80a001eb | 67 | msg_reloading Bjorb |
68 | killproc bjorb -HUP | |
69 | RETVAL=$? | |
70 | else | |
80a001eb | 71 | msg_not_running bjorb >&2 |
72 | RETVAL=7 | |
73 | fi | |
74 | ;; | |
75 | force-reload) | |
76 | # if program allows reloading without stopping | |
77 | $0 reload | |
78 | ||
79 | # or if it doesn't | |
80 | $0 restart | |
81 | ||
82 | exit $? | |
83 | ;; | |
84 | status) | |
85 | status bjorb | |
86 | RETVAL=$? | |
87 | ;; | |
88 | *) | |
80a001eb | 89 | msg_usage "$0 {start|stop|restart|reload|force-reload|status}" |
90 | exit 3 | |
91 | esac | |
92 | ||
93 | exit $RETVAL | |
94 | ||
95 | # This must be last line ! | |
96 | # vi:syntax=sh:tw=78:ts=8:sw=4 |