[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

Re: [Openvpn-users] variables in up scripts


  • Subject: Re: [Openvpn-users] variables in up scripts
  • From: sam <samwun@xxxxxxxxxxxxxxxx>
  • Date: Sat, 17 Jul 2004 16:13:01 +0800

Jon Bendtsen wrote:

Den 17. jul 2004, kl. 9:49, skrev sam:

Jon Bendtsen wrote:

Den 16. jul 2004, kl. 13:01, skrev sam:

James Yonan wrote:

- When using ifconfig to configure a static ip or ifconfig pool to assign
an ip is there any way to capture the connecting pc's hostname?



The OpenVPN server will save the client's IP address, port, and certificate common name as environmental variables for the --up script or --client-connect script to use.



I wondering how to extract the value of the variables from the up script.
I would like to extract the value from the client's certificate.
Is there any example?



make a script that uses

export  >>  $(tempfile)

and tell openvpn to run it.


JonB

I created a script called get-vars.sh with the following content:
export >> $(tempfile)
but I got the following error when I tried to execute the openvnp server:


Jul 17 15:48:57 fbsd openvpn[29719]: get-vars.sh tap0 1500 1590 10.8.0.1 255.255.255.0 init
Jul 17 15:48:57 fbsd openvpn[29719]: script failed: could not execute shell command
Jul 17 15:48:57 fbsd openvpn[29719]: Exiting


Here is the permission of the get-vars.sh file:
# ls -l get-vars.sh
-rw-r-xr--  1 root  wheel  24 Jul 17 15:48 get-vars.sh*


make it executeable for all.
Then try to see if it works
then include it in openvpn


JonB

ok, I make it to nobody:nogroup, it works. But I don't know where it exports the variables to.


thanks
sam


____________________________________________ Openvpn-users mailing list Openvpn-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/openvpn-users