0

I've been battling with this for a while with mixed results. I frequently move my laptop between it's dock (wired) and my couch (wireless). Anytime I switch networks, I have to manually run "sudo mount -a" to get my shares back. It's not a huge deal, but I'd like to fix it.

Here's my fstab right now:

//192.168.0.50/backup /media/backup cifs iocharset=utf8,sec=ntlm 0 0 
//192.168.0.50/videos /media/videos cifs iocharset=utf8,sec=ntlm 0 0 
//192.168.0.50/dvr /media/dvr cifs iocharset=utf8,sec=ntlm 0 0 
//192.168.0.50/apps /media/apps cifs iocharset=utf8,sec=ntlm 0 0 
//192.168.0.50/music /media/music cifs iocharset=utf8,sec=ntlm 0 0 
//192.168.0.50/temp /media/temp cifs iocharset=utf8,sec=ntlm 0 0 

Ideas?

Bonus info: when I switch to the wired connection, I have to manually use the network indicator icon to disable networking, and re-enable it.

Big Millz
  • 325
  • 3
  • 17

1 Answers1

2

You can add script in /etc/network/if-up.d/ and when wlan0 go up call script witch will do sudo mount -a.

Make script called script with execute permissions 755

sudo nano /etc/network/if-up.d/script

# Check for specific interface if desired
[ "$IFACE" != "wlan0" ] || exit 0
# Do something
sudo mount -a
2707974
  • 10,758