You guys are awesome. Thanks for the great responses!

Anne 

-----Original Message-----
From: Jordan Brown (Sun) [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 09, 2008 2:17 PM
To: Anne Moore
Cc: zones-discuss@opensolaris.org
Subject: Re: [zones-discuss] Script run from global zone into local zones -
to shut them down

Anne Moore wrote:
> All
>  
> I'm trying to write a script that will shutdown all zones from the 
> local zone. I'm not terribly good with scripting (yet), but thought 
> many of you would be.
>  
> I need to run the command "zoneadm list" and then output each line to 
> a different variable to run this command:
>  
> zlogin $zonename1 shutdown -y -g0 -i0
>  
> Does anyone know how one would do something like this?
>  
> Thank you for all of your help!

something like

        for z in `zoneadm list`
        do
            zlogin $z shutdown -y -g0 -i0
        done

though a bit better might be

        for z in `zoneadm list`
        do
            if [ $z != global ]
            then
                zlogin $z shutdown -y -g0 -i0
            fi
        done

_______________________________________________
zones-discuss mailing list
zones-discuss@opensolaris.org

Reply via email to