]> git.pld-linux.org Git - packages/accel-ppp.git/blame - accel-ppp.init
- updated description
[packages/accel-ppp.git] / accel-ppp.init
CommitLineData
ebfe6087
SP
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
4bd8014d 11# pidfile: /var/run/accel-ppp/accel-ppp.pid
c0e65c69 12#
4bd8014d 13# $Id$
ebfe6087 14#
ebfe6087
SP
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.
22if 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
27else
28 exit 0
29fi
30
ebfe6087
SP
31# Get service config - may override defaults
32[ -f /etc/sysconfig/accel-ppp ] && . /etc/sysconfig/accel-ppp
33
c0e65c69 34pidfile="/var/run/accel-ppp/accel-ppp.pid"
ebfe6087 35
ebfe6087
SP
36start() {
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
bac2e180
SP
43 if [ ! -f /var/run/accel-ppp/seq ]; then
44 echo "0" > /var/run/accel-ppp/seq
45 fi
46
ebfe6087 47 msg_starting "accel-pppd"
c0e65c69 48 daemon /usr/sbin/accel-pppd $OPTIONS
ebfe6087
SP
49 RETVAL=$?
50 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/accel-ppp
51}
52
53stop() {
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"
ebfe6087
SP
61 killproc --pidfile $pidfile accel-pppd -TERM
62 rm -f /var/lock/subsys/accel-ppp
63}
64
65reload() {
66 if [ ! -f /var/lock/subsys/accel-ppp ]; then
67 msg_not_running "accel-pppd"
68 RETVAL=7
69 return
70 fi
71
ebfe6087 72 msg_reloading "accel-pppd"
ebfe6087
SP
73 killproc --pidfile $pidfile accel-pppd -HUP
74 RETVAL=$?
75}
76
77condrestart() {
78 if [ ! -f /var/lock/subsys/accel-ppp ]; then
79 msg_not_running "accel-pppd"
80 RETVAL=$1
81 return
82 fi
83
ebfe6087
SP
84 stop
85 start
86}
87
88RETVAL=0
89# See how we were called.
90case "$1" in
91 start)
92 start
93 ;;
94 stop)
95 stop
96 ;;
97 restart)
ebfe6087
SP
98 stop
99 start
100 ;;
101 try-restart)
102 condrestart 0
103 ;;
4bd8014d 104# XXX: duplicate force-reload, remove one depending whether it supports reload or not
ebfe6087
SP
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 ;;
4bd8014d 110# XXX: duplicate force-reload, remove one depending whether it supports reload or not
ebfe6087
SP
111# use this one if program doesn't support reloading without restart
112 force-reload)
113 condrestart 7
114 ;;
ebfe6087 115 status)
392aeb7c 116 status accel-pppd
ebfe6087
SP
117 RETVAL=$?
118 ;;
119 *)
a98497aa 120 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
ebfe6087
SP
121 exit 3
122esac
123
124exit $RETVAL
This page took 0.074693 seconds and 4 git commands to generate.