What would be correct syntax in a script to check to see if a /export/nfs/home mount point is mounted and if not stop/abort? OS is Solaris 10 using standard VI ksh shell. Here is the script. Please tell me where you see the problem.
#!/bin/bash
#
# This script is run as root to sync AMI PROD to DR.
#
#
# Verify we are effectively root
#if ($> != 0){
# warn "must be root to use this script\n";
# usage();
#}
if [[ `grep -qs /export/nfs/home` /etc/dfs/sharetab ]]; then
echo "filesystem mounted running rsync"
else
echo "Aborted because filesystem not mounted"
exit -1
fi
#Rotate log before beginning
/usr/local/bin/logrotate -f ./conf/logrotate.conf
#### Perform the rsync now ####
/usr/local/bin/rsync -anvz -e ssh --rsync-path=/usr/local/bin/rsync root@prod03:/export/nfs/home/ root@dr03:/export
/nfs/home/
~