]> git.pld-linux.org Git - packages/dante.git/blob - sockd.init
- LSB conformance
[packages/dante.git] / sockd.init
1 #!/bin/sh
2 #
3 # sockd         This shell script takes care of starting and stopping
4 #               the Dante server.
5 #
6 # chkconfig:    2345 65 35
7 # description:  sockd implements a socks v4/v5 proxy server
8 #
9 # processname:  sockd
10 # pidfile:      /var/run/sockd.pid
11
12
13 # Source function library
14 . /etc/rc.d/init.d/functions
15
16 # Get network config
17 . /etc/sysconfig/network
18
19 # Get service config
20 [ -f /etc/sysconfig/sockd ] && . /etc/sysconfig/sockd
21
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24         if [ ! -f /var/lock/subsys/network ]; then
25                 # nls "ERROR: Networking is down. %s can't be run." <service>
26                 msg_network_down sockdd
27                 exit 1
28         fi
29 else
30         exit 0
31 fi
32
33 RETVAL=0
34 # See how we were called.
35 case "$1" in
36   start)
37         # Check if the service is already running?
38         if [ ! -f /var/lock/subsys/sockd ]; then
39                 msg_starting sockd
40                 daemon sockd -D
41                 RETVAL=$?
42                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sockd
43         else
44                 msg_already_running sockd
45         fi
46         ;;
47   stop)
48         # Stop daemons.
49         if [ -f /var/lock/subsys/sockd ]; then
50                 msg_stopping sockd
51                 killproc sockd
52                 rm -f /var/lock/subsys/sockd /var/run/sockd.pid >/dev/null 2>&1
53         else
54                 msg_not_running sockd
55         fi
56         ;;
57   status)
58         status sockd
59         exit $?
60         ;;
61   restart|force-reload)
62         $0 stop
63         $0 start
64         exit $?
65         ;;
66   *)
67         msg_usage "$0 {start|stop|restart|force-reload|status}"
68         exit 3
69 esac
70
71 exit $RETVAL
This page took 0.032158 seconds and 4 git commands to generate.