How to receive a mail on client connection and disconnecti ?
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVpn Newbie
- Posts: 4
- Joined: Wed Apr 20, 2011 7:49 am
How to receive a mail on client connection and disconnecti ?
Hi, i see we can use script, so we would like to receive a mail when a client is connecting to our server, and when he lost the connection?
Can we do that and how?
We are using openvpon 2.1.0 on Linux.
thanks
Can we do that and how?
We are using openvpon 2.1.0 on Linux.
thanks
- janjust
- Forum Team
- Posts: 2703
- Joined: Fri Aug 20, 2010 2:57 pm
- Location: Amsterdam
- Contact:
Re: How to receive a mail on client connection and disconnec
Use a 'client-connect' and 'client-disconnect' script. The script would do something like
Code: Select all
#!/bin/bash
echo "$script_type $common_name" | mail someuser@somehost
-
- OpenVpn Newbie
- Posts: 4
- Joined: Wed Apr 20, 2011 7:49 am
Re: How to receive a mail on client connection and disconnec
thanks, bu how do i use it? where do i put it?
thanks
thanks
- janjust
- Forum Team
- Posts: 2703
- Joined: Fri Aug 20, 2010 2:57 pm
- Location: Amsterdam
- Contact:
Re: How to receive a mail on client connection and disconnec
some work on your part is required: read the HOWTO and manual page, or buy my book and read chapter 6
-
- OpenVpn Newbie
- Posts: 4
- Joined: Wed Apr 20, 2011 7:49 am
Re: How to receive a mail on client connection and disconnec
haa okay thanks.i will try this.
-
- OpenVPN Power User
- Posts: 57
- Joined: Fri Apr 15, 2011 12:05 pm
Re: How to receive a mail on client connection and disconnec
where can i put that code?#!/bin/bash
echo "$script_type $common_name" | mail someuser@somehost
sorry noob question
- janjust
- Forum Team
- Posts: 2703
- Joined: Fri Aug 20, 2010 2:57 pm
- Location: Amsterdam
- Contact:
Re: How to receive a mail on client connection and disconnec
use a 'client-connect' script on the server side. Read the manual page or buy my book and read chapter 6
-
- OpenVpn Newbie
- Posts: 4
- Joined: Wed Apr 20, 2011 7:49 am
Re: How to receive a mail on client connection and disconnec
hi janjust, thanks a loy, it works like a charm