Run a command in all non-global Solaris zones
Obviously it only works from the global zone :-)
#!/usr/bin/sh# zonerun - run a command on all non global zones. Solaris 10.# 10-Mar-2005, ver 0.80# USAGE: zonerun [-v] command# eg,# zonerun uname -a# zonerun -v uptime# Standard Disclaimer: This is freeware, use at your own risk.# 10-Mar-2005 Brendan Gregg Created this.
PATH=/usr/bin:/usr/sbinverbose=0if [ "$1" = "-v" ]; thenshift; verbose=1fi
for zone in `zoneadm list`doif [ "$zone" = "global" ]; then continue; fiif [ $verbose -eq 1 ]; thenecho $zone,zlogin -S $zone "$*" | sed 's/^/ /'elsezlogin -S $zone "$*"fidone