#!/bin/ksh # # # # # # # # # # # # # # # # # # # # # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. # # This is a private command used by archiveadm(1M) to give the name of the # active boot environment for the specified zone. me=$(basename $0) if [[ -z $1 || $# != 1 || $1 == global ]]; then print -u2 "Usage: $me zone" exit 1 fi . /usr/lib/brand/shared/common.ksh init_zone zone "$1" if [[ -z ${zone.brand} ]]; then print -u2 "$me: Could not get brand for zone ${zone.name}" exit 1 fi if [[ ${zone.brand} == labeled ]]; then common_ksh=/usr/lib/brand/solaris/common.ksh else common_ksh=/usr/lib/brand/${zone.brand}/common.ksh fi if [[ ! -f $common_ksh ]]; then print -u2 "$me: Brand ${zone.brand} has no common.ksh at $common_ksh" exit 1 fi . "$common_ksh" get_active_be zone || exit 1 print -- $(basename "${zone.active_ds}") exit 0