the untrusted IPs to find in
contractor-list.txt
the script should look something like that ... called by the openVPN Server
client-disconnect /root/contractor_disconnect.sh
#!/usr/local/bin/php -q
<?php
require_once('/etc/inc/notices.inc');
$name= getenv('ifconfig_pool_remote_ip');
$fp = fopen('contractor-list.txt','r');
if($fp)
{
while (!feof($fp))
{
$line = fgets($fp, 100);
if($name==str_replace('\n','','$line'))
{
$local_connect_value = " \n user_name: " . getenv('common_name') . " \n vpn_client_ip: " . getenv('ifconfig_pool_remote_ip') ." connected from " . getenv('trusted_ip') . " on " . date('F j, Y, g:i a');
if ( strrchr (__FILE__ , 'disconnect') ) {
$local_connect_value .= ", \n duration : " . round(((getenv('time_duration'))/3600),2) . " hours, or " . round(((getenv('time_duration'))/60),2) . " minutes, or " . getenv('time_duration') . " seconds,\n upload from vpn-client (received) : " . round(((getenv('bytes_received'))/1048576),2) . " MB, \n download to vpn-client (send) : " . round(((getenv('bytes_sent'))/1048576),2) ." MB. \n DISCONNECTED.";}
notify_all_remote($local_connect_value);
}
}
}
fclose($fp);
?>
but something is bot workin
so back to square one !