diff options
author | ahriman <ahriman@falte.red> | 2019-03-26 22:38:58 +0000 |
---|---|---|
committer | ahriman <ahriman@falte.red> | 2019-03-26 22:38:58 +0000 |
commit | 165868747c945aefad250a4173a4572131addbb3 (patch) | |
tree | edd7c3f8c1fac56010051d4f511ccc43fa9cbeb6 /bin | |
parent | 320fe56137603b7a09c6ba362498a496109d162c (diff) | |
download | admin-165868747c945aefad250a4173a4572131addbb3.tar.gz |
connusers.py now shows users connected via mosh
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/connusers.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/connusers.py b/bin/connusers.py index eee4e7e..1128c34 100755 --- a/bin/connusers.py +++ b/bin/connusers.py @@ -13,10 +13,11 @@ def checkconns(): print("Can't access connected user table. Who are you?") exit(0) - connusers = list(set(subprocess.check_output("/usr/bin/who -q; exit 0", stderr=subprocess.STDOUT,shell=True).decode().splitlines()[0].split())) + connusers = list(set(subprocess.check_output("/usr/local/bin/showwhoison | sed -n '1!p'; exit 0", stderr=subprocess.STDOUT,shell=True).decode().split("\n"))) conntable.write("<ul>\n") for conn in connusers: - conntable.write("<li><a href=\"https://"+ conn +".tilde.institute\">"+ conn +"</a></li>\n") + if conn != "" and conn != "root": + conntable.write("<li><a href=\"https://"+ conn +".tilde.institute\">"+ conn +"</a></li>\n") conntable.write("</ul>\n") |