1 #!/sbin/sh
2 #
3 # CDDL HEADER START
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License, Version 1.0 only
7 # (the "License"). You may not use this file except in compliance
8 # with the License.
9 #
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
14 #
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
20 #
21 # CDDL HEADER END
22 #
23 #
24 # Copyright (c) 2000-2001 by Sun Microsystems, Inc.
25 # All rights reserved.
26 #
27 #ident "%Z%%M% %I% %E% SMI"
28
29 PATH=/sbin:/usr/bin:/usr/sbin; export PATH
30 PPPDIR=/etc/ppp; export PPPDIR
31
32 case "$1" in
33 'start')
34 if [ ! -x /usr/bin/pppd -o ! -c /dev/sppp ]; then
35 echo "$0: Solaris PPP has not been correctly installed on"
36 echo "$0: this system. Required files are missing."
37 exit 1
38 fi
39 if [ -f $PPPDIR/ifconfig ]; then
40 . $PPPDIR/ifconfig
41 fi
42 if [ -f $PPPDIR/demand ]; then
43 . $PPPDIR/demand
44 fi
45 if [ -f $PPPDIR/pppoe.if ] && [ -x /usr/sbin/sppptun ]; then
46 sed -e 's/^#.*//;s/\([^\\]\)#.*/\1/;s/[ ]*$//;s/^[ ]*//' \
47 $PPPDIR/pppoe.if | \
48 while read intf; do
49 if [ "$intf" ]; then
50 /usr/sbin/sppptun plumb pppoe $intf
51 /usr/sbin/sppptun plumb pppoed $intf
52 fi
53 done
54 fi
55 if [ -f $PPPDIR/pppoe ] && [ -x /usr/lib/inet/pppoed ]; then
56 /usr/lib/inet/pppoed >/dev/null
57 fi
58 ;;
59
60 'stop')
61 /usr/bin/pkill -x pppd
62 sleep 1
63 /usr/bin/pkill -x pppoed
64
65 # Use ifconfig to make the interfaces down just in case
66 if [ -f $PPPDIR/ifconfig ]; then
67 nawk '/ifconfig[ ]*sppp/ { \
68 system("ifconfig " $2 " down"); \
69 system("ifconfig " $2 " unplumb"); \
70 next; \
71 } \
72 /ifconfig/ { \
73 $3 = "removeif"; \
74 NF = 4; \
75 system($0); \
76 }' < $PPPDIR/ifconfig
77 fi
78
79 if [ -f $PPPDIR/pppoe.if ] && [ -x /usr/sbin/sppptun ]; then
80 sed -e 's/^#.*//;s/\([^\\]\)#.*/\1/;s/[ ]*$//;s/^[ ]*//' \
81 $PPPDIR/pppoe.if | \
82 while read intf; do
83 if [ "$intf" ]; then
|
1 #!/sbin/sh
2 #
3 # CDDL HEADER START
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22 #
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 #
26
27 PATH=/sbin:/usr/bin:/usr/sbin; export PATH
28 PPPDIR=/etc/ppp; export PPPDIR
29
30 case "$1" in
31 'start')
32 if [ ! -x /usr/bin/pppd -o ! -c /dev/sppp ]; then
33 echo "$0: Solaris PPP has not been correctly installed on"
34 echo "$0: this system. Required files are missing."
35 exit 1
36 fi
37 if [ -f $PPPDIR/ifconfig ]; then
38 . $PPPDIR/ifconfig
39 fi
40 if [ -f $PPPDIR/demand ]; then
41 . $PPPDIR/demand
42 fi
43 if [ -f $PPPDIR/pppoe.if ] && [ -x /usr/sbin/sppptun ]; then
44 sed -e 's/^#.*//;s/\([^\\]\)#.*/\1/;s/[ ]*$//;s/^[ ]*//' \
45 $PPPDIR/pppoe.if | \
46 while read intf; do
47 if [ "$intf" ]; then
48 /usr/sbin/sppptun plumb pppoe $intf
49 /usr/sbin/sppptun plumb pppoed $intf
50 fi
51 done
52 fi
53 if [ -f $PPPDIR/pppoe ] && [ -x /usr/lib/inet/pppoed ]; then
54 /usr/lib/inet/pppoed >/dev/null
55 fi
56 ;;
57
58 'stop')
59 /usr/bin/pkill -z `/sbin/zonename` -x pppd && sleep 1
60 /usr/bin/pkill -z `/sbin/zonename` -x pppoed
61
62 # Use ifconfig to make the interfaces down just in case
63 if [ -f $PPPDIR/ifconfig ]; then
64 nawk '/ifconfig[ ]*sppp/ { \
65 system("ifconfig " $2 " down"); \
66 system("ifconfig " $2 " unplumb"); \
67 next; \
68 } \
69 /ifconfig/ { \
70 $3 = "removeif"; \
71 NF = 4; \
72 system($0); \
73 }' < $PPPDIR/ifconfig
74 fi
75
76 if [ -f $PPPDIR/pppoe.if ] && [ -x /usr/sbin/sppptun ]; then
77 sed -e 's/^#.*//;s/\([^\\]\)#.*/\1/;s/[ ]*$//;s/^[ ]*//' \
78 $PPPDIR/pppoe.if | \
79 while read intf; do
80 if [ "$intf" ]; then
|