I mount a SMB share at boot-time.
I now have created a script to test to see if the share is mounted.
Code:
#!/bin/bash
SUCCESS=`mount|grep engineer|cut -d '/' -f3`
FAIL=`mount|grep engineers|cut -d '/' -f3`
echo $SUCCESS
echo #FAIL
if [ -n $SUCCESS ]
then
echo "Engineer Mounted."
else
echo "Engineer NOT Mounted."
fi
if [ -n $FAIL ]
then
echo "Engineers Mounted."
else
echo "Engineers NOT Mounted."
fi
This is just a test script.
If I run mount I get:
Code:
root@gcnpd:~/scripts# mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.22-14-generic/volatile type tmpfs (rw)
securityfs on /sys/kernel/security type securityfs (rw)
//gcctfs1/engineer on /media/engineer type smbfs (rw)
The last line is the one of interest.
Here are the results of a run of my script:
Code:
root@gcnpd:~/scripts# ./temp.sh
gcctfs1
Engineer Mounted.
Engineers Mounted.
Why does the $FAIL case "succeed"?
Any thoughts?
Chris