surely use zoneadm halt instead of zlogin ?
   along with zoneadm list -p and grep for running zones..

for z in `zoneadmn list -p | grep running | grep -v global | awk -F: '{print 
$2}'`
do
   zoneadm halt $z
done

Regards,
Sean.
.
Craig Cory stated:
< Anne,
< 
< Something like this should work for you:
< 
< ===============================
< #!/bin/sh
< 
< for z in `zoneadm list`
< do
<   if [ "$z" = "global" ]; then continue
<   fi
<   zlogin $z shutdown -y -g0 -i0
< done
< 
< ================================
< 
< Regards,
< 
< Craig
< 
< 
< In response to Anne Moore, who said:
< > 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!
< >
< > Anne
< >
< >
< > _______________________________________________
< > zones-discuss mailing list
< > zones-discuss@opensolaris.org
< 
< 
< Craig Cory
<  Senior Instructor :: ExitCertified
<  : Sun Certified System Administrator
<  : Sun Certified Network Administrator
<  : Sun Certified Security Administrator
<  : Veritas Certified Instructor
< 
<  8950 Cal Center Drive
<  Bldg 1, Suite 110
<  Sacramento, California  95826
<  [e] [EMAIL PROTECTED]
<  [p] 916.669.3970
<  [f] 916.669.3977
<  [w] WWW.EXITCERTIFIED.COM
< +---------------------------------------------------------------------+
<    OTTAWA | SACRAMENTO | MONTREAL | LAS VEGAS | QUEBEC CITY | CALGARY
<         SAN FRANCISCO | VANCOUVER | REGINA | WINNIPEG | TORONTO
< _______________________________________________
< zones-discuss mailing list
< zones-discuss@opensolaris.org
_______________________________________________
zones-discuss mailing list
zones-discuss@opensolaris.org

Reply via email to