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.
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.
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]
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
27 PATH
=/sbin
:/usr
/bin
:/usr
/sbin
; export PATH
28 PPPDIR
=/etc
/ppp
; export PPPDIR
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."
37 if [ -f $PPPDIR/ifconfig
]; then
40 if [ -f $PPPDIR/demand
]; then
43 if [ -f $PPPDIR/pppoe.
if ] && [ -x /usr
/sbin
/sppptun
]; then
44 sed -e 's/^#.*//;s/\([^\\]\)#.*/\1/;s/[ ]*$//;s/^[ ]*//' \
46 while read intf saps sapd
; do
48 [ -z "$saps" ] || saps
="-s $saps"
49 /usr
/sbin
/sppptun plumb
$saps pppoe
$intf
50 [ -z "$sapd" ] || sapd
="-s $sapd"
51 /usr
/sbin
/sppptun plumb
$sapd pppoed
$intf
55 if [ -f $PPPDIR/pppoe
] && [ -x /usr
/lib
/inet
/pppoed
]; then
56 /usr
/lib
/inet
/pppoed
>/dev
/null
61 /usr
/bin
/pkill
-z `/sbin/zonename` -x pppd
&& sleep 1
62 /usr
/bin
/pkill
-z `/sbin/zonename` -x pppoed
64 # Use ifconfig to make the interfaces down just in case
65 if [ -f $PPPDIR/ifconfig
]; then
66 nawk
'/ifconfig[ ]*sppp/ { \
67 system("ifconfig " $2 " down"); \
68 system("ifconfig " $2 " unplumb"); \
78 if [ -f $PPPDIR/pppoe.
if ] && [ -x /usr
/sbin
/sppptun
]; then
79 sed -e 's/^#.*//;s/\([^\\]\)#.*/\1/;s/[ ]*$//;s/^[ ]*//' \
81 while read intf rest
; do
83 /usr
/sbin
/sppptun unplumb
${intf}:pppoe
84 /usr
/sbin
/sppptun unplumb
${intf}:pppoed
91 echo "Usage: $0 { start | stop }"