Script for NFS mount point

Hi ,

i have create the bash script for nfs but in this script asking for mount point only once it is it prompting for second time.

example: do you wants to create any other mount point [yes/no]?
note(if i give yes it should ask me to add the mount point else it should proceed with next step) it should ask each and every time if i give "yes" and add the mount point in it...

myscript:

echo " enter the mount point name"
read e
echo "$e *(rw,sync,no_root_squash)" >>/etc/exports
"Note:here it should ask again if any mount point needs to be added or not?
if yes it should start from again.."

service nfs restart
exportfs -r
exportfs -v
chkconfig nfs on

Put a while loop around your mount point extension part:

AGAIN=YES
  while [ "$AGAIN" = "YES" ]
   do read e
      echo $e
      read -p "Again? " AGAIN
   done

Watch out: No error checking etc included yet...

This one is faster to operate

while :
do
 echo " enter the mount point name (empty to quit)"
 read e
 [ -z "$e" ] && break
 echo "$e *(rw,sync,no_root_squash)" >>/etc/exports
done

Thanks it working, but while mounting the share path in client machine if i have 2 share path in server how do i mount that 2 share path in client.

i have highlited some points in my script please help me how to resolve that...

while :
do
echo " enter the mount point name (empty to quit)"
read e
[ -z "$e" ] && break
echo "$e *(rw,sync,no_root_squash)" >>/etc/exports
done
service nfs restart
exportfs -r
exportfs -v
chkconfig nfs on
------------(Note: This is client server ip address)--------------------------
echo "enter the destserverip"
read a
-----------------------------------------------
#(Note:here i wants to enter source server ip address and mount point problem here is if i provide 2 share path 
how do i add that here)
----------------------------------------------------------------
echo "enter src serverip and mount point"
read b c
----------------------------------------------------------------------
(note this point us i want to create the mount point in client server if i have 2 share path how do i create the directoryor )
----------------------------------------------------------------------
 
echo "1. Do you wants to create the mount point[yes/no]?"
read n
yes=$(echo $n | tr -s '[:upper:]' '[:lower:]')
if [[ "$n" = "yes" ]]; then
-----------------------------------------------------------------------
(Note: if mount point is already created in client server how do i mention that 2 mount point details here)
-----------------------------------------------------------------------
echo "enter the dir name to create mount point"
read f
ssh -p 22 -l root $a mkdir $f
echo " enter the root password"
ssh -p 22 -l root $a mount -t nfs $b:$c $f
else
echo "enter the destmount point ensure the mount point is created"
read d
#ssh -p 22 -l root $a mkdir $f
echo " enter the root password"
ssh -p 22 -l root $a mount -t nfs $b:$c $d
fi 

A bit more safe and compact; I left your one comment that I don't understand.

while :
do
  echo " enter the mount point name (empty to quit)"
  read e
  [ -z "$e" ] && break
  echo "$e *(rw,sync,no_root_squash)" >>/etc/exports
done
service nfs restart
exportfs -r
exportfs -v
chkconfig nfs on
------------(Note: This is client server ip address)--------------------------
echo "enter the destserverip"
read a
-----------------------------------------------
#(Note:here i want to enter source server ip address and mount point problem here is if i provide 2 share path 
how do i add that here)
----------------------------------------------------------------
echo "enter src serverip and mount point"
read b c
echo "enter the destmount point (created when not present)"
read d
# echo "enter the root password"
ssh -n -q -p 22 -l root "$a" "# multi-line string starts here
# -p: create if needed
mkdir -p $d
mount -t nfs ${b}:${c} $d
# multi-line string ends here"

Thanks, it works only in single mount point but i wants to mount multiple mount point to destination client server... how do i do that?