Allow for different hotp files/secrets

Just call as ./gen_hotp.py <filename>.
If filename is omitted, use default duotoken.hotp.
This commit is contained in:
Andreas Thienemann 2019-03-20 00:48:54 +01:00
parent 5a410e565f
commit 389909b424
1 changed files with 6 additions and 1 deletions

View File

@ -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())