From 389909b4247cd6c327632f1965aaa5a94cf0e6c9 Mon Sep 17 00:00:00 2001 From: Andreas Thienemann Date: Wed, 20 Mar 2019 00:48:54 +0100 Subject: [PATCH] Allow for different hotp files/secrets Just call as ./gen_hotp.py . If filename is omitted, use default duotoken.hotp. --- duo_gen.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/duo_gen.py b/duo_gen.py index c001ccd..49c185c 100755 --- a/duo_gen.py +++ b/duo_gen.py @@ -7,7 +7,12 @@ import json import sys from urllib2 import unquote -f = open("duotoken.hotp","r+"); +if len(sys.argv) == 2: + file = sys.argv[1] +else: + file = "duotoken.hotp" + +f = open(file, "r+"); secret = f.readline()[0:-1] offset = f.tell() count = int(f.readline())