aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2018-09-05 22:37:35 +0200
committerFlorian Bruhin <me@the-compiler.org>2018-09-05 22:37:35 +0200
commitf7b17d978cc4e9687dff326bc04d5e763922c934 (patch)
treeb5f0f39210954c59f1b1a9c3474b31348e489fcd
parent6b887143d70d155eb17db89935d66a7e829ff98a (diff)
downloadhsrvpn-f7b17d978cc4e9687dff326bc04d5e763922c934.tar.gz
hsrvpn-f7b17d978cc4e9687dff326bc04d5e763922c934.zip
Add hsrvpn-showtoken
-rwxr-xr-xhsrvpn-showtoken13
1 files changed, 13 insertions, 0 deletions
diff --git a/hsrvpn-showtoken b/hsrvpn-showtoken
new file mode 100755
index 0000000..83a4bce
--- /dev/null
+++ b/hsrvpn-showtoken
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+
+import argparse
+
+import keyring
+
+parser = argparse.ArgumentParser()
+parser.add_argument('user', help="HSR Username")
+args = parser.parse_args()
+
+tokens = keyring.get_password('hsrvpn-secrets', args.user).split()
+print(tokens.pop(0))
+keyring.set_password('hsrvpn-secrets', args.user, '\n'.join(tokens))