Contents of /trunk/ppp/ppp.rc
Parent Directory | Revision Log
Revision 309 -
(show annotations)
(download)
Sun Aug 19 02:42:41 2007 UTC (17 years, 2 months ago) by niro
File size: 892 byte(s)
Sun Aug 19 02:42:41 2007 UTC (17 years, 2 months ago) by niro
File size: 892 byte(s)
-variable provider support
1 | #!/bin/bash |
2 | # $Header: /root/magellan-cvs/src/ppp/ppp.rc,v 1.4 2007-08-19 02:42:41 niro Exp $ |
3 | |
4 | #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k |
5 | #%start: 30 |
6 | #%stop: 30 |
7 | |
8 | #deps |
9 | #%needs: |
10 | #%before: |
11 | #%after: |
12 | |
13 | source /etc/sysconfig/rc |
14 | 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) |
19 | |
20 | case "$1" in |
21 | start) |
22 | echo -e ${COLOREDSTAR}"Starting PPP deamon ..." |
23 | [[ -z ${PPPD_PID} ]] && pon ${PPP_PROVIDER} |
24 | evaluate_retval |
25 | |
26 | update_svcstatus $1 |
27 | splash svc_started "$(basename $0)" 0 |
28 | ;; |
29 | |
30 | stop) |
31 | echo -e ${COLOREDSTAR}"Stopping PPP daemon ..." |
32 | [[ ! -z ${PPPD_PID} ]] && poff -a &> /dev/null |
33 | evaluate_retval |
34 | |
35 | update_svcstatus $1 |
36 | splash svc_stopped "$(basename $0)" 0 |
37 | ;; |
38 | |
39 | restart) |
40 | $0 stop |
41 | sleep 1 |
42 | $0 start |
43 | ;; |
44 | |
45 | status) |
46 | statusproc /usr/sbin/pppd |
47 | ;; |
48 | |
49 | *) |
50 | echo "Usage: $0 {start|stop|restart|status}" |
51 | exit 1 |
52 | ;; |
53 | esac |