I can successfully mount an SMB share if I do this:
sudo mount -v -t cifs -o username=neubert,password=whatever //192.168.1.128/shared /media/shared
Like if I do that and go to /media/shared in the File Explorer I can view the contents of the mount point.
Putting this into my /etc/fstab, however, does not result in /media/shared being auto-mounted when I start the computer up:
//192.168.1.128/shared /media/shared cifs username=neubert,password=whatever,rw,uid=1000,gid=1000
No problem, I thought, I'll just put the mount command into my ~/.bashrc. If I just put it in my ~/.bashrc file without some sort of if statement, however, it'll give me errors whenever that location is already mounted so I tried this:
if mount -l | grep -q 192.168.1.128then sudo mount -v -t cifs -o username=neubert,password=whatever //192.168.1.128/shared /media/sharedfi
Unfortunately, that doesn't work. Like even if I put that in a standalone test.sh file nothing is mounted, which just seems strange to me given that this reliably tells me if 192.168.1.128 is mounted or not:
if mount -l | grep -q 192.168.1.128then echo "OK";else echo "NOT OK";fi
Any ideas?