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