Hardware Management Console Best Practices
- 55 -
echo "user names not specified"
usage
fi
if [ "$op" == "add" ]; then
# some validation here
if [ "$access" == "" ]; then
echo "missing HMC access role."
usage
fi
for i in $hl
do
ping -c 1 $i >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Unable to contact "$i
echo "Skipping this host."
continue
fi
for u in $ul
do
pass=$u$RANDOM
ssh $lid@$i mkhmcusr -u $u -a $access -d "User
$u" --passwd $pass -M 90
if [ $? -eq 0 ]; then
echo "Created user "$u" with default
password "$pass" on "$i
else
echo "Failed to create user "$u" on "$i
fi
done
done
fi
if [ "$op" == "delete" ]; then
for i in $hl
do
ping -c 1 $i >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Unable to contact "$i
echo "Skipping this host."
continue
fi
for u in $ul
do
ssh $lid@$i rmhmcusr -u $u
echo "in delete"
Komentáře k této Příručce