6 Commits
editor ... main

Author SHA1 Message Date
fc15f8fff7 delete root from active 2026-06-23 01:16:53 +02:00
59f1607812 active users fix 2026-06-23 00:54:31 +02:00
4f00bccbe5 Merge pull request 'move all steps to functions' (#7) from editor into main
Reviewed-on: #7
2026-06-23 00:52:03 +02:00
f082adf206 Merge pull request 'feat: add active users script' (#8) from io/helpers:main into main
Reviewed-on: #8
2026-06-23 00:51:52 +02:00
iodomi
9381838e4f fix: check users connected thru ssh 2026-06-22 22:59:12 +02:00
iodomi
62cdc6a67d feat: add active users script 2026-06-22 14:43:18 +02:00

12
active-users Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/php
<?php
$jsonFile = '/opt/html/online.json';
$activeUsers = shell_exec("ps -eo user=,comm= | awk '$2 ~ /sshd/ {print $1}' | grep -vE 'sshd|root' | sort -u");
$activeUsersArray = array_filter(explode("\n", $activeUsers));
$activeUsersJson = json_encode($activeUsersArray, JSON_PRETTY_PRINT);
file_put_contents($jsonFile, $activeUsersJson);
?>