]> git.pld-linux.org Git - packages/dante.git/blame - sockd.init
- remove remnants from template.init
[packages/dante.git] / sockd.init
CommitLineData
30b7a6a0 1#!/bin/sh
2#
f33ec771 3# sockd This shell script takes care of starting and stopping
4# the Dante server.
30b7a6a0 5#
f33ec771 6# chkconfig: 2345 65 35
7# description: sockd implements a socks v4/v5 proxy server
30b7a6a0 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.
f33ec771 23if is_yes "${NETWORKING}"; then
a4a67615 24 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
f33ec771 25 msg_network_down sockdd
26 exit 1
27 fi
28else
29 exit 0
30b7a6a0 30fi
31
2ae8fcc2 32RETVAL=0
30b7a6a0 33# See how we were called.
34case "$1" in
35 start)
36 # Check if the service is already running?
f33ec771 37 if [ ! -f /var/lock/subsys/sockd ]; then
30b7a6a0 38 msg_starting sockd
39 daemon sockd -D
f33ec771 40 RETVAL=$?
30b7a6a0 41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sockd
42 else
f33ec771 43 msg_already_running sockd
30b7a6a0 44 fi
45 ;;
46 stop)
f33ec771 47 # Stop daemons.
30b7a6a0 48 if [ -f /var/lock/subsys/sockd ]; then
f33ec771 49 msg_stopping sockd
50 killproc sockd
f33ec771 51 rm -f /var/lock/subsys/sockd /var/run/sockd.pid >/dev/null 2>&1
52 else
53 msg_not_running sockd
30b7a6a0 54 fi
55 ;;
56 status)
57 status sockd
58 exit $?
59 ;;
2ae8fcc2 60 restart|force-reload)
30b7a6a0 61 $0 stop
62 $0 start
f33ec771 63 exit $?
64 ;;
30b7a6a0 65 *)
2ae8fcc2 66 msg_usage "$0 {start|stop|restart|force-reload|status}"
67 exit 3
30b7a6a0 68esac
69
70exit $RETVAL
This page took 0.182544 seconds and 4 git commands to generate.