From 7b444c3f897aff70dfb6cb48cc782503d01904be Mon Sep 17 00:00:00 2001 From: R4SAS Date: Sun, 4 Jun 2017 23:27:01 +0300 Subject: [PATCH] add comment ignore --- bin/py-i2phosts-injector | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/py-i2phosts-injector b/bin/py-i2phosts-injector index 00a5832..8bc8b6a 100755 --- a/bin/py-i2phosts-injector +++ b/bin/py-i2phosts-injector @@ -77,7 +77,9 @@ for line in f: continue # strip trailing '\n' line = line.rstrip('\n') - entry = line.split('=', 1) + # split and ignore comment after b64hash + data = line.split("#!", 1) + entry = data[0].split("=", 1) try: hostname = validate_hostname(entry[0]) base64 = validate_b64hash(entry[1], check_uniq=False) # don't require uniqueness