2

Currently I connect to a VPN before I start work. Then at some point I notice I need access to a network resource. So I need to open file manager and attempt to access the mount point and it will get mounted and I have access.
There is a line in fstab for the mount allowing it to get mounted when I try to access it, but I need to load the directory in file manager to get access to it, and this only works once I have connected to VPN. Ideally I would connect to VPN and the drive would get mounted.

Currently fstab has this line to mount the drive

//files.host/directory /media/directory cifs credentials=/home/path/.smbcredentials,iocharset=utf8,users,sec=ntlmssp,uid=1000,gid=1000,file_mode=0755,dir_mode=0755 0 0

I am using openconnect to connect to vpn via gnome networkmanager vpn settings.

1

1 Answer 1

3

Ideally I would connect to VPN and the drive would get mounted.

Create an executable script that starts the command you need to execute to connect to the VPN and add a line behind it with " && " and the command to mount the drive. Then instead of using the normal command you use that script. If you use an icon to connect to the VPN change the ".desktop" file to have it start this new script.

Mind that to give a better answer you should add information to your question about the commands used to connect to the VPN and to mount the drive.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .