Have a smaller system with limited drive space; in this case, a mini PC that has zero room for expansion, and is only used for conference room display purposes. Not really much to be gained by upgrading this cheap little box.
In order to have access to our internal server, I've used SSHFS to mount the remote shares. Could easily be NFS, Samba or whatever, but for this example, that's what I've used. This is a two part solution:
Step One: In /etc/NetworkManager/dispatcher.d, create a file called "netdrives" (or whatever). In it, put:
Code:
#! /bin/sh
. /etc/rc.status
case "$2" in
up)
/usr/local/bin/NetMount.sh
;;
*)
exit 0
;;
esac
Note the line bolded above; that's another script file located somewhere else, that contains your mount commands. So, when the interface comes up, it'll run this, and not before.
Step Two: Create the mount script. Can be as simple or complex as you want it; in my case, it's only several lines like this:
Code:
sudo -u user sshfs user@10.11.12.13:/some/remote/path /some/local/path -o allow_other
This will mount the shares as my 'regular' user account, allowing me full read/write.
Handy for the house, too, if you have a NAS you'd like to mount when you hook up to your home network.