access env variables from config file

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
evelio
OpenVpn Newbie
Posts: 1
Joined: Fri Mar 06, 2015 12:57 am

access env variables from config file

Post by evelio » Fri Mar 06, 2015 1:03 am

Hello,

1- Is it possible to access env variables from the config file and do something like this?

if untrusted_ip == subnet/mask:
some option
else:
something else
2- Or is it possible to call an external script, test the variable there and then from the script push
an option to the client?

The thing is some of my users need different config options depending on where they are connecting from. Specif the inactive option.
I dont want to create a different instance because that would complicate the config and im not sure i can assign the same client subnet
on two different openvpn instances. (I'm using pfsense).

any ideas?


regards,
evelio

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: access env variables from config file

Post by Traffic » Fri Mar 06, 2015 11:03 am

See --client-connect in The Manual v23x

env variables are available to scripts but not openvpn config files.

Post Reply