Last active
January 15, 2024 08:22
-
-
Save bamthomas/1d3a5a9a575a2f9c821cd85813bc710d to your computer and use it in GitHub Desktop.
nb connected users on wifi lighthttpd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "<h1>Utilisateurs connectes</h1>" | |
set -x | |
total=0 | |
for interface in $(iwinfo |grep "ESSID:" | cut -d' ' -f1); do | |
nb_interface_users=$(iwinfo $interface assoclist | grep dBm | wc -l) | |
total=$((total + nb_interface_users)) | |
done | |
echo "il y a $total utilisateurs connectes" | |
echo "<h2>Details</h2>" | |
echo "<pre>" | |
for interface in $(iwinfo |grep "ESSID:" | cut -d' ' -f1); do | |
echo $'\n' | |
echo -n "Interface $interface : " | |
iwinfo $interface assoclist | xargs |sed 's/..:..:..:..:..:../\n&/g' | |
done | |
echo "</pre>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment