diff options
-rwxr-xr-x | bin/connusers.py | 12 | ||||
-rwxr-xr-x | bin/regusers.py | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/bin/connusers.py b/bin/connusers.py index 1128c34..26ab112 100755 --- a/bin/connusers.py +++ b/bin/connusers.py @@ -15,9 +15,15 @@ def checkconns(): 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: - if conn != "" and conn != "root": - conntable.write("<li><a href=\"https://"+ conn +".tilde.institute\">"+ conn +"</a></li>\n") + + seen = set() + for conns in connusers: + split = conns.split(' ') + for conn in split: + if conn != "" and conn != " " and conn != "root" and conn not in seen: + seen.add(conn) + conntable.write("<li><a href=\"https://"+ conn +".tilde.institute\">"+ conn +"</a></li>\n") + conntable.write("</ul>\n") diff --git a/bin/regusers.py b/bin/regusers.py index e6fff77..2c482d9 100755 --- a/bin/regusers.py +++ b/bin/regusers.py @@ -22,6 +22,6 @@ if __name__ == "__main__": regusers = get_regusers("/home") usertable.write("<ul>\n") for user in sorted(regusers): - if user != ".git" and user != "ahriman" and user != "uucp" and user != "admins": + if user != "lost+found" and user != ".git" and user != "uucp" and user != "admins": usertable.write("<li><a href=\"https://"+ user +".tilde.institute\">"+ user +"</a></li>\n") usertable.write("</ul>\n") |