xref: /onnv-gate/usr/src/lib/brand/shared/zone/query.ksh (revision 12199:2dbcb597eb37)
1*12199Sgerald.jelinek@sun.com#!/bin/ksh -p
2*12199Sgerald.jelinek@sun.com#
3*12199Sgerald.jelinek@sun.com# CDDL HEADER START
4*12199Sgerald.jelinek@sun.com#
5*12199Sgerald.jelinek@sun.com# The contents of this file are subject to the terms of the
6*12199Sgerald.jelinek@sun.com# Common Development and Distribution License (the "License").
7*12199Sgerald.jelinek@sun.com# You may not use this file except in compliance with the License.
8*12199Sgerald.jelinek@sun.com#
9*12199Sgerald.jelinek@sun.com# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*12199Sgerald.jelinek@sun.com# or http://www.opensolaris.org/os/licensing.
11*12199Sgerald.jelinek@sun.com# See the License for the specific language governing permissions
12*12199Sgerald.jelinek@sun.com# and limitations under the License.
13*12199Sgerald.jelinek@sun.com#
14*12199Sgerald.jelinek@sun.com# When distributing Covered Code, include this CDDL HEADER in each
15*12199Sgerald.jelinek@sun.com# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*12199Sgerald.jelinek@sun.com# If applicable, add the following below this CDDL HEADER, with the
17*12199Sgerald.jelinek@sun.com# fields enclosed by brackets "[]" replaced with your own identifying
18*12199Sgerald.jelinek@sun.com# information: Portions Copyright [yyyy] [name of copyright owner]
19*12199Sgerald.jelinek@sun.com#
20*12199Sgerald.jelinek@sun.com# CDDL HEADER END
21*12199Sgerald.jelinek@sun.com#
22*12199Sgerald.jelinek@sun.com#
23*12199Sgerald.jelinek@sun.com# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24*12199Sgerald.jelinek@sun.com#
25*12199Sgerald.jelinek@sun.com
26*12199Sgerald.jelinek@sun.comPATH=/usr/bin:/usr/sbin
27*12199Sgerald.jelinek@sun.comexport PATH
28*12199Sgerald.jelinek@sun.com
29*12199Sgerald.jelinek@sun.com. /usr/lib/brand/shared/common.ksh
30*12199Sgerald.jelinek@sun.com
31*12199Sgerald.jelinek@sun.comzonename=$1
32*12199Sgerald.jelinek@sun.comzonepath=$2
33*12199Sgerald.jelinek@sun.comcmd=$3
34*12199Sgerald.jelinek@sun.com
35*12199Sgerald.jelinek@sun.comif [ $3 == "datasets" ]; then
36*12199Sgerald.jelinek@sun.com	get_zonepath_ds $zonepath
37*12199Sgerald.jelinek@sun.com
38*12199Sgerald.jelinek@sun.com	DS=`/usr/sbin/zfs list -H -t filesystem -o name $ZONEPATH_DS/ROOT`
39*12199Sgerald.jelinek@sun.com	if [ ! -z "$DS" ]; then
40*12199Sgerald.jelinek@sun.com		echo "$DS\c"
41*12199Sgerald.jelinek@sun.com	else
42*12199Sgerald.jelinek@sun.com		fail_fatal "$f_no_ds"
43*12199Sgerald.jelinek@sun.com	fi
44*12199Sgerald.jelinek@sun.comfi
45*12199Sgerald.jelinek@sun.com
46*12199Sgerald.jelinek@sun.comexit $ZONE_SUBPROC_OK
47