HP-UX vPars and Integrity VM V6.3 Administrator Guide

typeset -i XN
ADDFLAG=0
AUTOBDT=0
QUIET=0
USERDISKCNT=0
USERTGT=0
XN=$XNDEFAULT
#
# Get cmd line options
#
while getopts :aF:f:HhN:n:P:qTt: option
do
case $option in
a) # add flag - do actual call to hpvmmodify
ADDFLAG=1
a=$a+1
;;
F) # hpvmmodify flags
FLAGS=$OPTARG
F=$F+1
;;
f) # disklist file
DISKLISTFILE=$OPTARG
f=$f+1
;;
H) # Help
usage
exit 0
;;
h) # help
usage
exit 0
;;
N) # number of disks to add from the disklistfile
USERDISKCNT=$OPTARG
N=$N+1
;;
n) # number of disks to add at a time
XN=$OPTARG
n=$n+1
;;
P) # guest name
GUESTNAME=$OPTARG
P=$P+1
;;
q) # quiet mode
QUIET=1
q=$q+1
;;
T) # time the add command
TIMECMD="timex"
T=$T+1
;;
t) # target max
USERTGT=$OPTARG
AUTOBDT=1
t=$t+1
;;
?) # error
echo "ERROR: Error with option: $OPTARG (unknown option, or missing value"
usage
exit 1
;;
esac
done
#
# Verify cmd line options
#
if [ $a -gt 1 ] || [ $F -gt 1 ] || [ $f -gt 1 ] || [ $N -gt 1 ] || [ $n -gt 1 ] || \
[ $P -gt 1 ] || [ $q -gt 1 ] || [ $T -gt 1 ] || [ $t -gt 1 ]
then
echo "ERROR: Duplicate arguments are not allowed."
exit 1
fi
if [ $P -eq 0 ]
then
echo "ERROR: '-P guestname' must be specified."
exit 1
fi
if [ $f -eq 0 ]
then
echo "ERROR: '-f disklistfile' must be specified."
exit 1
fi
if [[ ! -f $DISKLISTFILE ]]
then
echo "ERROR: Could not find disklist file: $DISKLISTFILE"
284 Sample script for adding multiple devices