Been working on a script for several hours now. Am trying to NFS mount some filesystems coming off of several different hosts to a box after it is rebooted. Here is what my script looks like:
#!/bin/ksh
#
for SERVER in `cat /bin/danka/nfs.lis|cut -f 1 -d :`
do
for MP in `cat /bin/danka/nfs.lis|cut -f 3 -d :`
do
for FS in `cat /bin/danka/nfs.lis|cut -f 2 -d :`
do
if ! ping -c 5 ${SERVER} 1>/dev/null 2>/dev/null
then
clear
echo "\n\n\n"
echo "Server: ${SERVER} is not available......\n"
echo "Contact UNIX Support.....\n\n\n"
exit
fi
if mount |grep -q -w ${MP}
then
clear
echo "\n\n\n"
echo "The $MP mount point is already mounted......\n"
echo "Contact UNIX Support.....\n\n\n"
exit
fi
if mount $SERVER:$FS $MP
then
clear
echo "\n\n\n"
echo "The $FS mount point has been mounted.......\n"
fi
done
done
done
***********************************************************
the nfs.lis file that it searches has several entries in it that look like this:
host:filesystem:mountpoint
host:filesystem:mountpoint
host:filesystem:mountpoint
************************************************************
when I run this job, the first NFS filesystem is mounted, I then get a message that states the other NFS filesystems are already mounted(but they are not of course). Can someone please lend their expertise to this problem. Your help would be greatly appreciated. Thanks
#!/bin/ksh
#
for SERVER in `cat /bin/danka/nfs.lis|cut -f 1 -d :`
do
for MP in `cat /bin/danka/nfs.lis|cut -f 3 -d :`
do
for FS in `cat /bin/danka/nfs.lis|cut -f 2 -d :`
do
if ! ping -c 5 ${SERVER} 1>/dev/null 2>/dev/null
then
clear
echo "\n\n\n"
echo "Server: ${SERVER} is not available......\n"
echo "Contact UNIX Support.....\n\n\n"
exit
fi
if mount |grep -q -w ${MP}
then
clear
echo "\n\n\n"
echo "The $MP mount point is already mounted......\n"
echo "Contact UNIX Support.....\n\n\n"
exit
fi
if mount $SERVER:$FS $MP
then
clear
echo "\n\n\n"
echo "The $FS mount point has been mounted.......\n"
fi
done
done
done
***********************************************************
the nfs.lis file that it searches has several entries in it that look like this:
host:filesystem:mountpoint
host:filesystem:mountpoint
host:filesystem:mountpoint
************************************************************
when I run this job, the first NFS filesystem is mounted, I then get a message that states the other NFS filesystems are already mounted(but they are not of course). Can someone please lend their expertise to this problem. Your help would be greatly appreciated. Thanks