Hi Scott,
I have modify your script into this. I commented out the execution line.
for rule in $(isi nfs exports list |egrep '^ *[1-9]'|awk '{print $1}')
do
for host in $(isi nfs exports list -i $rule -r -v | tr '\[' '\n' | grep ^host | cut -d\] -f1 | awk -F ' ' '{print $2}')
do
echo -e "\tBad hostname $host found."
#Run an nslookup on that hostname to make sure it doesn't return an ip address
#return 0 if selected lines are found, in this case no ip found result is not 0
nslookup $host | grep Add | grep -v "#"
if [[ $? != 0 ]]; then
echo -e "\tNSLOOKUP on $host failed, $host have no IP"
echo "Removing client $host from export number $rule"
#isi nfs exports modify -i $rule --delete-client=$host
fi
done
done
Trinh