#!/usr/bin/ksh ####################################### . /usr/bin/zonebkpfunctions ZONELIST=`zoneadm list -ip | nawk -F: '$1 != 0 {print $2}'` if [ "$ZONELIST" = "" ] then echo "No non-global-zones available." exit 1 fi getoptions $@ # check options if [ "$HELP" = 1 ] then usage exit 0 fi if [ "$LIST" = 1 ] then echo "$ZONELIST" exit 0 fi if [ "$ZBACKUP" = 1 ] then # check if BACKUPDIR exists. if [ ! -d "$BACKUPDIR" ] then echo "$BACKUPDIR: No such backup directory!" exit 1 fi # check if each zone is in ZONELIST for Z in $ZONES do ZCHECK=`echo $ZONELIST | grep -w $Z | wc -l` if [ "$ZCHECK" -eq 0 ] then if [ "$Z" = "global" ] then echo "Cannot backup global zone!" exit 1 else echo "Zone $Z does not exist!" exit 1 fi fi done # Backup ZONES zonebackup "$ZONES" fi exit 0