blob: 28376f4f21605bc7362d6a070fdb56a8f1462ef1
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 | # Modifed to work with SuSE 6.4 linux by Gary Cameron. |
14 | # |
15 | # Source function library. |
16 | #. /etc/rc.d/init.d/functions # For red hat? |
17 | . /etc/rc.config # For SuSE, enables setting from /etc/rc.config |
18 | |
19 | #Tweak this |
20 | restart_time=120 |
21 | |
22 | # From AUTOCONF |
23 | prefix=@prefix@ |
24 | exec_prefix=@exec_prefix@ |
25 | |
26 | # Paths to programs |
27 | START=@sbindir@/pppoe-start |
28 | STOP=@sbindir@/pppoe-stop |
29 | STATUS=@sbindir@/pppoe-status |
30 | |
31 | test "$PPPoE_START" = "yes" || exit 0 |
32 | |
33 | # The echo return value for success (defined in /etc/rc.config). |
34 | return=$rc_done |
35 | case "$1" in |
36 | start) |
37 | echo -n "Bringing up PPPoE link" |
38 | $START > /dev/null 2>&1 || return=$rc_failed |
39 | echo -e "$return" |
40 | ;; |
41 | |
42 | stop) |
43 | echo -n "Shutting down PPPoE link" |
44 | $STOP > /dev/null 2>&1 || return=$rc_failed |
45 | echo -e "$return" |
46 | ;; |
47 | |
48 | restart) |
49 | $0 stop |
50 | echo "Waiting" $restart_time "seconds for the host to reset itself" |
51 | sleep $restart_time #Note: Need time for host to reset itself |
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 |