Files
wevads-platform/scripts/api_sessions-count.php
2026-02-26 04:53:11 +01:00

9 lines
300 B
PHP
Executable File

<?php
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
$netstat = shell_exec("netstat -tn 2>/dev/null | grep ':5821' | grep ESTABLISHED | awk '{print \$5}' | cut -d: -f1 | sort -u | wc -l");
$count = intval(trim($netstat));
echo json_encode(['count' => $count]);