diff --git a/configs/scripts/wg-handshakes b/configs/scripts/wg-handshakes index dc8a574..74528dc 100755 --- a/configs/scripts/wg-handshakes +++ b/configs/scripts/wg-handshakes @@ -65,6 +65,12 @@ def main() -> int: ap.add_argument( "--dns-server", "-d", help="Override the DNS server to use for RDNS lookups" ) + ap.add_argument( + "--format", + default="text", + choices=["text", "html"], + help="The format to output", + ) args = ap.parse_args() # Get the output of wg show @@ -112,8 +118,18 @@ def main() -> int: outputs.sort(key=lambda x: x[1], reverse=True) # Print the outputs - for output in outputs: - print(f"{output[0]}: {output[2]}") + if args.format == "text": + for output in outputs: + print(f"{output[0]}: {output[2]}") + elif args.format == "html": + print("WireGuard Handshakes") + print("") + print("") + print("") + for output in outputs: + print(f"") + print("
NameLast Handshake
{output[0]}{output[2]}
") + print("") return 0