What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Mail when vpn connection is made

Mobo1964

Occasional Visitor
I'm looking for a possibility to sent a mail when a OPENVPN client connection is made.

In /jffs/scripts/openvpn-event a have
(-rwxr-xr-x 1 admin root 349 Feb 18 20:16 openvpn-event*)

#!bin/sh
echo openvpn-event-started > /tmp/000openvpn-started-log

But when connection is made this is not working
 
Last edited:
Hello Ford Perfect,

I have seen these. The gmail notification script I use a lot, as an template with adding parameters to sent the required information.

But what I want is information when a vpn connection is made, I can not find the right information for using in /jffs/scripts/openvpn-event
 
...appologies...I swear I did not see your reference to the jffs openvpn-event script in the first place.
Man, I am balding fast.... :(

Ok, just for the records...

- you state that you are using the shebang "#!bin/sh"..that is not correct...misses a slash, use "#!/bin/sh" instead.
- what kind of connection do you want to monitor? ...openvpn server running on ASUS and external client connect to trigger the event? I understand, that in this case, the jffs script is not for you.
There is a server parameter, called "--client-connect cmd" in openvpn server.
You could hook in your script in there, maybe.
You can pass the parameter in the vpn config as a custom configuration.
Edit: Here's some food for the brain: https://forums.openvpn.net/topic10024.html
 
Last edited:
The shebang error is a typo here. I will take a look at the topic. What I want is receiving an email when someone is connecting to my openvpn server running on my router.

Verstuurd vanaf mijn GT-I9505 met Tapatalk
 
can not find antything about client-connect on Asus (Merlin) Openvpn

Place the following statements in the VPN configuration (I use GmailOpenVPN.sh as the name of my script).

Regards,
 

Attachments

  • 19-02-2014 19-53-57.jpg
    19-02-2014 19-53-57.jpg
    87.9 KB · Views: 621
Thanks, that was what I'm looking for,

I use it now with my generic gmail-notification script which uses a parameter to sent the appropriate information

script-security 2
client-connect /jffs/scripts/gmail-notification openvpn-event
 
Last edited:
My custom configuration is: (15-5-2015 15-41-13.png)
username-as-common-name
push "route 192.168.10.0 255.255.255.0"

Adding these options to the custom configuration in advanced setting for VPN
script-security 2
client-connect /jffs/scripts/gmail-notification openvpn-event

results in: (15-5-2015 15-43-06.png)
Initialinzing the settings of OpenVPN server now, please wait a few minutes to let the server to setup completed before VPN clients establish the connection.

which be running for ever it seems, when changing it back all working as normal.

What am I doing wrong?
 

Attachments

  • 15-5-2015 15-43-06.png
    15-5-2015 15-43-06.png
    104.2 KB · Views: 1,060
  • 15-5-2015 15-41-13.png
    15-5-2015 15-41-13.png
    6.2 KB · Views: 830
My custom configuration is: (15-5-2015 15-41-13.png)
username-as-common-name
push "route 192.168.10.0 255.255.255.0"

Adding these options to the custom configuration in advanced setting for VPN
script-security 2
client-connect /jffs/scripts/gmail-notification openvpn-event

results in: (15-5-2015 15-43-06.png)
Initialinzing the settings of OpenVPN server now, please wait a few minutes to let the server to setup completed before VPN clients establish the connection.

which be running for ever it seems, when changing it back all working as normal.

What am I doing wrong?

If you have a /jffs/scripts/openvpn-event script that has syntax errors then this will happen, but I suspect as you appear to be passing the name of a script to run called openvpn-event it doesn't exist! :eek:

I suggest you remove 'openvpn-event' from the panel.

Also check the log to see why the server is failing if this is not the case.
 
Last edited:

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top