1 |
#!/bin/bash |
#!/bin/bash |
2 |
# $Header: /root/magellan-cvs/src/ppp/ppp.rc,v 1.2 2007-08-18 18:56:38 niro Exp $ |
# $Header: /root/magellan-cvs/src/ppp/ppp.rc,v 1.5 2009-05-11 09:39:01 niro Exp $ |
3 |
|
|
4 |
#%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k |
#%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k |
5 |
#%start: 30 |
#%start: 30 |
10 |
#%before: |
#%before: |
11 |
#%after: |
#%after: |
12 |
|
|
13 |
source /etc/sysconfig/rc |
source /etc/conf.d/rc |
14 |
source $rc_functions |
source $rc_functions |
15 |
|
|
16 |
|
[[ -f /etc/conf.d/ppp ]] && source /etc/conf.d/ppp |
17 |
|
|
18 |
PPPD_PID=$(pidof -o %PPID /usr/sbin/pppd) |
PPPD_PID=$(pidof -o %PPID /usr/sbin/pppd) |
19 |
|
|
20 |
case "$1" in |
case "$1" in |
21 |
start) |
start) |
22 |
echo -e ${COLOREDSTAR}"Starting PPP deamon ..." |
echo -e ${COLOREDSTAR}"Starting PPP deamon ..." |
23 |
[[ -z ${PPPD_PID} ]] && pon |
[[ -z ${PPPD_PID} ]] && pon ${PPP_PROVIDER} |
24 |
if [ $? -gt 0 ] |
evaluate_retval |
|
then |
|
|
print_status failure |
|
|
else |
|
|
start-stop-daemon --start --quiet \ |
|
|
--pidfile /var/run/pppd.pid --exec /usr/sbin/pppd |
|
|
print_status success |
|
|
fi |
|
25 |
|
|
26 |
update_svcstatus $1 |
update_svcstatus $1 |
27 |
splash svc_started "$(basename $0)" 0 |
splash svc_started "$(basename $0)" 0 |
30 |
stop) |
stop) |
31 |
echo -e ${COLOREDSTAR}"Stopping PPP daemon ..." |
echo -e ${COLOREDSTAR}"Stopping PPP daemon ..." |
32 |
[[ ! -z ${PPPD_PID} ]] && poff -a &> /dev/null |
[[ ! -z ${PPPD_PID} ]] && poff -a &> /dev/null |
33 |
if [ $? -gt 0 ] |
evaluate_retval |
|
then |
|
|
print_status failure |
|
|
else |
|
|
start-stop-daemon --stop --quiet --pidfile /var/run/pppd.pid |
|
|
print_status success |
|
|
fi |
|
34 |
|
|
35 |
update_svcstatus $1 |
update_svcstatus $1 |
36 |
splash svc_stopped "$(basename $0)" 0 |
splash svc_stopped "$(basename $0)" 0 |