Print this page
XXX Remove nawk(1)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/tsol/zones/zoneunshare.sh
+++ new/usr/src/cmd/tsol/zones/zoneunshare.sh
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
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
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 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24 #
25 -#ident "%Z%%M% %I% %E% SMI"
26 -#
27 25 # zoneunshare -- unshare zone resources
28 26
29 27 # Processes the specified sharetab file and unshare
30 28 # all entries shared by the specfied zone
31 29
32 30 USAGE="zoneunshare -z zonename [- | file]"
33 31 set -- `getopt z: $*`
34 32 if [ $? != 0 ] # invalid options
35 33 then
36 34 echo $USAGE >&2
37 35 exit 1
38 36 fi
39 37 for i in $* # pick up the options
40 38 do
41 39 case $i in
42 40 -z) zonename=$2; shift 2;;
43 41 --) shift; break;;
44 42 esac
45 43 done
46 44
47 45 zoneattr=`/usr/sbin/zoneadm -z $zonename list -p 2> /dev/null`
48 46 if [ $? -ne 0 ] # invalid zone
49 47 then
50 48 echo $USAGE >&2
51 49 exit 1
52 50 fi
53 51
54 52 prefix=`echo $zoneattr | cut -d ":" -f4`
55 53 rootpath=$prefix/root
56 54
57 55 if [ $# -gt 1 ] # accept only one argument
58 56 then
59 57 echo $USAGE >&2
60 58 exit 1
61 59 elif [ $# = 1 ]
62 60 then
63 61 case $1 in
64 62 -) infile=;; # use stdin
65 63 *) infile=$1;; # use a given source file
66 64 esac
↓ open down ↓ |
30 lines elided |
↑ open up ↑ |
67 65 else
68 66 infile=/etc/dfs/sharetab # default
69 67 fi
70 68
71 69 # Run unshare for each resource in its own shell
72 70
73 71 while read line # get complete lines
74 72 do
75 73 echo $line
76 74 done < $infile |
77 - `egrep "^$rootpath"|nawk '{ print "/usr/sbin/unshare " $1 ";" }'|/sbin/sh`
75 + `egrep "^$rootpath"|/usr/xpg4/bin/awk '{ print "/usr/sbin/unshare " $1 ";" }'|/sbin/sh`
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX