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 (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2014 Nexenta Systems, Inc. All rights reserved.
25
26 . /lib/svc/share/smf_include.sh
27
28 #
29 # Return a list of running, non-global zones for which a shutdown via
30 # "/sbin/init 0" may work (typically only Solaris zones.)
31 #
32 shutdown_zones()
33 {
34 zoneadm list -p | nawk -F: '{
35 if ($2 != "global") {
36 print $2
37 }
38 }'
39 }
40
41 [ ! -x /usr/sbin/zoneadm ] && exit 0 # SUNWzoneu not installed
42
43 if [ -z "$SMF_FMRI" ]; then
44 echo "this script can only be invoked by smf(5)"
45 exit $SMF_EXIT_ERR_NOSMF
46 fi
47
48 # Make sure working directory is / to prevent unmounting problems.
49 cd /
50 PATH=/usr/sbin:/usr/bin; export PATH
51
52 case "$1" in
53 'start')
54 egrep -vs '^#|^global:' /etc/zones/index || exit 0 # no local zones
55
|
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 (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2014 Nexenta Systems, Inc. All rights reserved.
25
26 . /lib/svc/share/smf_include.sh
27
28 #
29 # Return a list of running, non-global zones for which a shutdown via
30 # "/sbin/init 0" may work (typically only Solaris zones.)
31 #
32 shutdown_zones()
33 {
34 zoneadm list -p | nawk -F: '{
35 if (($5 != "lx") && ($2 != "global")) {
36 print $2
37 }
38 }'
39 }
40
41 [ ! -x /usr/sbin/zoneadm ] && exit 0 # SUNWzoneu not installed
42
43 if [ -z "$SMF_FMRI" ]; then
44 echo "this script can only be invoked by smf(5)"
45 exit $SMF_EXIT_ERR_NOSMF
46 fi
47
48 # Make sure working directory is / to prevent unmounting problems.
49 cd /
50 PATH=/usr/sbin:/usr/bin; export PATH
51
52 case "$1" in
53 'start')
54 egrep -vs '^#|^global:' /etc/zones/index || exit 0 # no local zones
55
|