]> git.pld-linux.org Git - packages/accel-ppp.git/blob - accel-ppp.init
- updated description
[packages/accel-ppp.git] / accel-ppp.init
1 #!/bin/sh
2 #
3 # accel-ppp     accel-ppp service
4 #
5 # chkconfig:    345 90 15
6 #
7 # description:  accel-ppp (High performance VPN server application)
8 #
9 # processname:  accel-pppd
10 # config:       /etc/accel-ppp.conf
11 # pidfile:      /var/run/accel-ppp/accel-ppp.pid
12 #
13 # $Id$
14 #
15 # Source function library
16 . /etc/rc.d/init.d/functions
17
18 # Get network config
19 . /etc/sysconfig/network
20
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
24                 msg_network_down "accel-ppp"
25                 exit 1
26         fi
27 else
28         exit 0
29 fi
30
31 # Get service config - may override defaults
32 [ -f /etc/sysconfig/accel-ppp ] && . /etc/sysconfig/accel-ppp
33
34 pidfile="/var/run/accel-ppp/accel-ppp.pid"
35
36 start() {
37         # Check if the service is already running?
38         if [ -f /var/lock/subsys/accel-ppp ]; then
39                 msg_already_running "accel-pppd"
40                 return
41         fi
42
43         if [ ! -f /var/run/accel-ppp/seq ]; then
44                 echo "0" > /var/run/accel-ppp/seq
45         fi
46
47         msg_starting "accel-pppd"
48         daemon /usr/sbin/accel-pppd $OPTIONS
49         RETVAL=$?
50         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/accel-ppp
51 }
52
53 stop() {
54         if [ ! -f /var/lock/subsys/accel-ppp ]; then
55                 msg_not_running "accel-pppd"
56                 return
57         fi
58
59         # Stop daemons.
60         msg_stopping "accel-pppd"
61         killproc --pidfile $pidfile accel-pppd -TERM
62         rm -f /var/lock/subsys/accel-ppp
63 }
64
65 reload() {
66         if [ ! -f /var/lock/subsys/accel-ppp ]; then
67                 msg_not_running "accel-pppd"
68                 RETVAL=7
69                 return
70         fi
71
72         msg_reloading "accel-pppd"
73         killproc --pidfile $pidfile accel-pppd -HUP
74         RETVAL=$?
75 }
76
77 condrestart() {
78         if [ ! -f /var/lock/subsys/accel-ppp ]; then
79                 msg_not_running "accel-pppd"
80                 RETVAL=$1
81                 return
82         fi
83
84         stop
85         start
86 }
87
88 RETVAL=0
89 # See how we were called.
90 case "$1" in
91   start)
92         start
93         ;;
94   stop)
95         stop
96         ;;
97   restart)
98         stop
99         start
100         ;;
101   try-restart)
102         condrestart 0
103         ;;
104 # XXX: duplicate force-reload, remove one depending whether it supports reload or not
105 # include force-reload here if program allows reloading without restart
106 # otherwise remove reload action and support force-reload as restart if running
107   reload|force-reload)
108         reload
109         ;;
110 # XXX: duplicate force-reload, remove one depending whether it supports reload or not
111 # use this one if program doesn't support reloading without restart
112   force-reload)
113         condrestart 7
114         ;;
115   status)
116         status accel-pppd
117         RETVAL=$?
118         ;;
119   *)
120         msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
121         exit 3
122 esac
123
124 exit $RETVAL
This page took 0.042426 seconds and 3 git commands to generate.