Apple Mac - Scripting profile importing

How to customize and extend your OpenVPN installation.
Post Reply
jelockwood
OpenVpn Newbie
Posts: 4
Joined: Mon Jan 29, 2018 4:07 pm

Apple Mac - Scripting profile importing

Post by jelockwood » Tue Jun 04, 2019 8:59 am

I would like to be able to write a script which automates the importing of a new or updated OpenVPN profile i.e. a .ovpn file.

I would then use an automated Mac management tool - Munki to automate deploying this to Mac clients.

Is there a command line tool that is part of the Mac OpenVPN client that can be used for this? I can see that an imported .ovpn file ends up in the -

/Library/Application Support/OpenVPN/profile/

directory. However I can also see that merely putting a copy in that directory and including a matching .info file is not sufficient. There is clearly some other entry added elsewhere.

So if there is no command line method I am prepared to copy files to the above directory but I also need to know what other file needs updating to 'inform' OpenVPN.

al_sedano
OpenVpn Newbie
Posts: 3
Joined: Sat Jul 20, 2019 10:45 am

Re: Apple Mac - Scripting profile importing

Post by al_sedano » Sat Jul 20, 2019 1:08 pm

This one is for Windows, but maybe it can inspire you to create another one: viewtopic.php?f=15&t=28613

jelockwood
OpenVpn Newbie
Posts: 4
Joined: Mon Jan 29, 2018 4:07 pm

Re: Apple Mac - Scripting profile importing

Post by jelockwood » Mon Jul 22, 2019 8:46 am

al_sedano wrote:
Sat Jul 20, 2019 1:08 pm
This one is for Windows, but maybe it can inspire you to create another one: viewtopic.php?f=15&t=28613
Unfortunately not. I already have a suitable single file OpenVPN config file and that is all the above seems to discuss.

The problem is having a binary i.e. part of the Mac OpenVPN client which has a command to import that config file. I examined the app bundle and inside it could not see an obvious candidate to do this - or at least none that gave back any helpful message via the command line.

To reiterate if it can already do it I need to know how to tell the Mac OpenVPN client to import an existing OpenVPN config file, or this feature needs adding to the OpenVPN client on Mac.

It can obviously be done via the GUI but that is not ideal for automation, at a minimum it would mean it could only happen via a logged in user session with users manually running an installer.

Post Reply