3 # accel-ppp accel-ppp service
7 # description: accel-ppp (High performance VPN server application)
9 # processname: accel-pppd
10 # config: /etc/accel-ppp.conf
15 # Source function library
16 . /etc/rc.d/init.d/functions
19 . /etc/sysconfig/network
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"
37 # Get service config - may override defaults
38 [ -f /etc/sysconfig/accel-ppp ] && . /etc/sysconfig/accel-ppp
40 pidfile="/var/run/accel-ppp.pid"
43 # must return non-zero if check failed
44 # output is discarded if checkconfig is ran without details
46 /usr/sbin/accel-pppd -t
50 # wrapper for configtest
54 if [ $details = 1 ]; then
55 # run config test and display report (status action)
56 show "Checking %s configuration" "accel-ppp"; busy
58 out=$(configtest 2>&1)
60 if [ $RETVAL = 0 ]; then
65 [ "$out" ] && echo >&2 "$out"
67 # run config test and abort with nice message if failed
68 # (for actions checking status before action).
69 configtest >/dev/null 2>&1
71 if [ $RETVAL != 0 ]; then
72 show "Checking %s configuration" "accel-ppp"; fail
73 nls 'Configuration test failed. See details with %s "checkconfig"' $0
80 # Check if the service is already running?
81 if [ -f /var/lock/subsys/accel-ppp ]; then
82 msg_already_running "accel-pppd"
87 msg_starting "accel-pppd"
88 daemon /usr/sbin/accel-pppd
90 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/accel-ppp
94 if [ ! -f /var/lock/subsys/accel-ppp ]; then
95 msg_not_running "accel-pppd"
100 msg_stopping "accel-pppd"
102 killproc --pidfile $pidfile accel-pppd -TERM
103 rm -f /var/lock/subsys/accel-ppp
107 if [ ! -f /var/lock/subsys/accel-ppp ]; then
108 msg_not_running "accel-pppd"
114 msg_reloading "accel-pppd"
115 killproc accel-pppd -HUP
116 killproc --pidfile $pidfile accel-pppd -HUP
121 if [ ! -f /var/lock/subsys/accel-ppp ]; then
122 msg_not_running "accel-pppd"
133 # See how we were called.
149 # include force-reload here if program allows reloading without restart
150 # otherwise remove reload action and support force-reload as restart if running
154 # use this one if program doesn't support reloading without restart
158 checkconfig|configtest)
166 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|checkconfig|status}"