Contents of /trunk/ppp/ppp.rc
Parent Directory | Revision Log
Revision 304 -
(show annotations)
(download)
Sat Aug 18 18:56:38 2007 UTC (17 years, 1 month ago) by niro
File size: 1115 byte(s)
Sat Aug 18 18:56:38 2007 UTC (17 years, 1 month ago) by niro
File size: 1115 byte(s)
-small fixup
1 | #!/bin/bash |
2 | # $Header: /root/magellan-cvs/src/ppp/ppp.rc,v 1.2 2007-08-18 18:56:38 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 | PPPD_PID=$(pidof -o %PPID /usr/sbin/pppd) |
17 | |
18 | case "$1" in |
19 | start) |
20 | echo -e ${COLOREDSTAR}"Starting PPP deamon ..." |
21 | [[ -z ${PPPD_PID} ]] && pon |
22 | if [ $? -gt 0 ] |
23 | then |
24 | print_status failure |
25 | else |
26 | start-stop-daemon --start --quiet \ |
27 | --pidfile /var/run/pppd.pid --exec /usr/sbin/pppd |
28 | print_status success |
29 | fi |
30 | |
31 | update_svcstatus $1 |
32 | splash svc_started "$(basename $0)" 0 |
33 | ;; |
34 | |
35 | stop) |
36 | echo -e ${COLOREDSTAR}"Stopping PPP daemon ..." |
37 | [[ ! -z ${PPPD_PID} ]] && poff -a &> /dev/null |
38 | if [ $? -gt 0 ] |
39 | then |
40 | print_status failure |
41 | else |
42 | start-stop-daemon --stop --quiet --pidfile /var/run/pppd.pid |
43 | print_status success |
44 | fi |
45 | |
46 | update_svcstatus $1 |
47 | splash svc_stopped "$(basename $0)" 0 |
48 | ;; |
49 | |
50 | restart) |
51 | $0 stop |
52 | sleep 1 |
53 | $0 start |
54 | ;; |
55 | |
56 | status) |
57 | statusproc /usr/sbin/pppd |
58 | ;; |
59 | |
60 | *) |
61 | echo "Usage: $0 {start|stop|restart|status}" |
62 | exit 1 |
63 | ;; |
64 | esac |