blob: 0d615652e318359233103bf30ea8990e699202a2
1 | #!/bin/sh |
2 | # |
3 | # pppoe This script starts or stops a PPPoE connection |
4 | # |
5 | # chkconfig: 2345 99 01 |
6 | # description: Connects to PPPoE provider |
7 | # |
8 | # LIC: GPL |
9 | # |
10 | # Copyright (C) 2000 Roaring Penguin Software Inc. This software may |
11 | # be distributed under the terms of the GNU General Public License, version |
12 | # 2 or any later version. |
13 | |
14 | # Source function library if it exists |
15 | test -r /etc/rc.d/init.d/functions && . /etc/rc.d/init.d/functions |
16 | |
17 | # From AUTOCONF |
18 | prefix=/usr |
19 | exec_prefix=${prefix} |
20 | |
21 | # Paths to programs |
22 | START=${exec_prefix}/sbin/pppoe-start |
23 | STOP=${exec_prefix}/sbin/pppoe-stop |
24 | STATUS=${exec_prefix}/sbin/pppoe-status |
25 | case "$1" in |
26 | start) |
27 | echo -n "Bringing up PPPoE link" |
28 | |
29 | $START |
30 | if [ $? = 0 ] ; then |
31 | touch /var/lock/subsys/pppoe |
32 | echo_success |
33 | else |
34 | echo_failure |
35 | fi |
36 | echo "" |
37 | ;; |
38 | |
39 | stop) |
40 | echo -n "Shutting down PPPoE link" |
41 | |
42 | $STOP > /dev/null 2>&1 |
43 | if [ $? = 0 ] ; then |
44 | rm -f /var/lock/subsys/pppoe |
45 | echo_success |
46 | else |
47 | echo_failure |
48 | fi |
49 | echo "" |
50 | ;; |
51 | |
52 | restart) |
53 | $0 stop |
54 | $0 start |
55 | ;; |
56 | |
57 | status) |
58 | $STATUS |
59 | ;; |
60 | |
61 | *) |
62 | echo "Usage: pppoe {start|stop|restart|status}" |
63 | exit 1 |
64 | esac |
65 | |
66 | exit 0 |
67 |