Hello everybody,
I’m trying to set the automatism that allows me to send the email as soon as a user connects in ovpn but every time he connects I don’t receive any email, can you help me to fix the script?
PS:I would like to avoid using scheduler / system script.
Thanks in advance
{
:local userid;
: local i;
: local realip;
: local vpnip;
: local uptime;
: local crttime;
: local crtdate;
:local userid
:foreach i in=[/ppp active find] do={
:set userid [/ppp active get $i name];
:set realip [/ppp active get $i caller-id];
:set vpnip [/ppp active get $i address];
:set uptime [/ppp active get $i uptime];
:set crtdate [/system clock get date];
:set crttime [/system clock get time];
/tool e-mail send to=nomeutente@gmail.com start-tls=yes subject=“TIME: $crtdate $crttime,USER_ID: $userid,UP-TIME: $uptime” body=“TIME: $crtdate $crttime, USER_ID: $userid; REAL-IP: $realip, VPN-IP: $vpnip, UP-TIME: $uptime”;
}
}