For me from this solution in stackoverflow_QA_Check if a directory exists in a shell script
[ -d /Volumes/ ] && echo "Already mounted /Volumes/ in OS X" || echo "Not mounted"
to use that
# 2 lines
$LOCALMOUNTPOINT="/folder/share" ;
[ -d $LOCALMOUNTPOINT ] && echo "Already mounted $LOCALMOUNTPOINT in OS X" || /sbin/mount -t smbfs //user:password@serveraddress/share $LOCALMOUNTPOINT
Here is Stackoverflow_QA_how-can-i-mount-an-smb-share-from-the-command-line
additional link about smb which I don't know well
# Here is my solution
$LOCALMOUNTPOINT="/folder/share" ;
[ ! -d $LOCALMOUNTPOINT ] && mkdir $LOCALMOUNTPOINT && /sbin/mount -t smbfs //user:password@serveraddress/share $LOCALMOUNTPOINT || echo already mounted $LOCALMOUNTPOINT
I have to make new folder for my SMOOTH use before mounting that.
so I added mkdir $LOCALMOUNTPOINT
Thank you I learned a lot with this case.
Have A nice day!!! ;)