From f83d6b5b5c0ca79217322200efead6963fc97f88 Mon Sep 17 00:00:00 2001 From: Arnaud Gomes Date: Fri, 17 Feb 2023 16:44:29 +0100 Subject: [PATCH] [enh] log connections and disconnections to syslog --- client-connect.php | 6 ++++++ client-disconnect.php | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100755 client-disconnect.php diff --git a/client-connect.php b/client-connect.php index 4a16dfd..c829a7d 100755 --- a/client-connect.php +++ b/client-connect.php @@ -28,6 +28,12 @@ file_put_contents($argv[1],"ifconfig-push ".$me["ip"]." ".long2ip(ip2long($me["ip"])+1)."\n"); +// Log what we're doing. +openlog("client-connect", LOG_PID, LOG_LOCAL4); +$ip=getenv("trusted_ip"); +syslog(LOG_NOTICE, "Connected user=".$username." ip=".$ip); +closelog(); + exit(0); diff --git a/client-disconnect.php b/client-disconnect.php new file mode 100755 index 0000000..a862c5e --- /dev/null +++ b/client-disconnect.php @@ -0,0 +1,15 @@ +#!/usr/bin/php +