On Fri 06 Jul 2007 at 12:15PM, Jerry Jelinek wrote:
> Russ Petruzzelli wrote:
> > In a script I'd like to run prtdiag if I am in a global zone.
> >
> > Is there a zoneadm command to tell me what kind of zone I'm in? It's
> > not jumping out at me in the zoneadm help.
> >
> > eg:
> >
> > if [[ <globalzone> == true ]]; then
> > ....
> >
> > OR.... is there a way to get this to run in a zone?...
> >
> > /usr/platform/SUNW,Ultra-80/sbin/prtdiag -v
>
> You could try this:
>
> if [ `/usr/bin/zonename` = "global" ]; then
Slightly better is to run /sbin/zonename, since that is available
even if root isn't mounted and even if zones package (SUNWzoneu) is
not installed.
(It's a bug that /usr/bin/zonename isn't delivered by SUNWcsu, but
we haven't got around to fixing it yet).
-dp
--
Daniel Price - Solaris Kernel Engineering - [EMAIL PROTECTED] - blogs.sun.com/dp
_______________________________________________
zones-discuss mailing list
[email protected]