M DXYZ
asked on
bash samba connection check/mount
Hi I need help creating a script which main purpose would be to check if the smbmount connection has been established. If is has not, then ask the user to enter the ip address of the node that will be tested. And the last portion would be to issue to smbmount command:
smbmount //10.5.0.3/icsglobal /mnt/iotest/ --verbose -o username=admin pass=admin1
smbmount //10.5.0.3/icsglobal /mnt/iotest/ --verbose -o username=admin pass=admin1
#Prompt for remote or local test, if is remote invoke samba, for local do nothing
#Samba check and mount
#Checking if mount /mnt/iotest directory exists
samba=/mnt/mountpoint
read -p "Please enter the ip address of the node to test: " -e ip
df -h |grep $samba
if [ -d $samba];then
echo "Directory $samba appears to be mounted"
else
if [ ! -d $samba];then
echo "Creating $samba directory"
echo "Mounting $samba directory for samba connection"
smbmount //10.5.0.3/mnt/iotest/ --verbose -o username=admin pass=admin1
fi
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.