Hello @mikej1234, I try Your script on my Debian 10 openvpn server and it fails. I make dir /etc/openvpn/scripts and add new file clientconnect.sh
#!/bin/bash
#Send an email when a client connects with today's time and date
NOW="$(date +"%H:%M:%S - %Y-%m-%d")"
sendmail alerts@company.com <<EOF
FROM: alerts@company.com
TO: me@company.com
SUBJECT: OpenVPN - CONNECTED: $common_name - $NOW
At $NOW, $common_name connected to the OpenVPN server.
IP: $trusted_ip
PORT: $trusted_port
MTU: $tun_mtu
.
EOF
exit 0
and add two lines to my server.conf:
script-security 3 system
client-connect /etc/openvpn/scripts/clientconnect.sh
after restart openvpn it fails. Do I have to make something else?
Regards.