Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/zoneadm/svc-zones
          +++ new/usr/src/cmd/zoneadm/svc-zones
↓ open down ↓ 22 lines elided ↑ open up ↑
  23   23  # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24  
  25   25  . /lib/svc/share/smf_include.sh
  26   26  
  27   27  #
  28   28  # Return a list of running, non-global zones for which a shutdown via
  29   29  # "/sbin/init 0" may work (typically only Solaris zones.)
  30   30  #
  31   31  shutdown_zones()
  32   32  {
  33      -        zoneadm list -p | nawk -F: '{
       33 +        zoneadm list -p | /usr/xpg4/bin/awk -F: '{
  34   34                  if ($2 != "global") {
  35   35                          print $2
  36   36                  }
  37   37          }'
  38   38  }
  39   39  
  40   40  [ ! -x /usr/sbin/zoneadm ] && exit 0    # SUNWzoneu not installed
  41   41  
  42   42  if [ -z "$SMF_FMRI" ]; then
  43   43          echo "this script can only be invoked by smf(5)"        
↓ open down ↓ 6 lines elided ↑ open up ↑
  50   50  
  51   51  case "$1" in
  52   52  'start')
  53   53          egrep -vs '^#|^global:' /etc/zones/index || exit 0  # no local zones
  54   54  
  55   55          #
  56   56          # Boot the installed zones for which the "autoboot" zone property is
  57   57          # set and invoke the sysboot hook for all other installed zones.
  58   58          #
  59   59          ZONES=""
  60      -        for zone in `zoneadm list -pi | nawk -F: '{
       60 +        for zone in `zoneadm list -pi | /usr/xpg4/bin/awk -F: '{
  61   61                          if ($3 == "installed") {
  62   62                                  print $2
  63   63                          }
  64   64                  }'`; do
  65   65                  zonecfg -z $zone info autoboot | grep "true" >/dev/null 2>&1
  66   66                  if [ $? -eq 0 ]; then
  67   67                          [ -z "$ZONES" ] && echo "Booting zones:\c"
  68   68                          ZONES=yes
  69   69                          echo " $zone\c"
  70   70                          #
↓ open down ↓ 105 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX