blob: aad06d65acb85ad966c9581d14069b8b77f316bc
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 | echo success |
32 | touch /var/lock/subsys/pppoe |
33 | else |
34 | echo failure |
35 | fi |
36 | ;; |
37 | |
38 | stop) |
39 | echo -n "Shutting down PPPoE link: " |
40 | |
41 | $STOP > /dev/null 2>&1 |
42 | if [ $? = 0 ] ; then |
43 | echo success |
44 | rm -f /var/lock/subsys/pppoe |
45 | else |
46 | echo failure |
47 | fi |
48 | ;; |
49 | |
50 | restart) |
51 | $0 stop |
52 | $0 start |
53 | ;; |
54 | |
55 | status) |
56 | $STATUS |
57 | ;; |
58 | |
59 | *) |
60 | echo "Usage: pppoe {start|stop|restart|status}" |
61 | exit 1 |
62 | esac |
63 | |
64 | exit 0 |
65 |