Issue #75: pass-in the target IP address as an option.
authorSteven Black <redacted>
Mon, 15 Feb 2016 22:06:38 +0000 (17:06 -0500)
committerSteven Black <redacted>
Mon, 15 Feb 2016 22:06:38 +0000 (17:06 -0500)
Use option --ip nnn.nnn.nnn.nnn or -i nnn.nnn.nnn.nnn to specify the IP address you want in the amalgamated hosts file.

updateHostsFile.py

index 12ade7ec84b05910c6bffc30f4401e596caa7b1d..ee73fc1c767c9413faad5ed873f3f634967d59be 100644 (file)
@@ -93,16 +93,18 @@ COMMON_EXCLUSIONS = ['hulu.com']
 exclusionRegexs = []
 numberOfRules   = 0
 auto = False
-verbose = True
-targetIP = '0.0.0.0'
+targetIP = "0.0.0.0"
 
 def main():
+
     parser = argparse.ArgumentParser(description="Creates an amalgamated hosts file from hosts stored in data subfolders.")
     parser.add_argument("--auto", "-a", dest="auto", default=False, action='store_true', help="Run without prompting.")
+    parser.add_argument("--ip", "-i", dest="targetIP", default="0.0.0.0", help="Target IP address. Default is 0.0.0.0")
     args = parser.parse_args()
 
-    global auto, verbose
+    global auto, targetIP
     auto = args.auto
+    targetIP = args.targetIP
 
     promptForUpdate()
     promptForExclusions()
git clone https://git.99rst.org/PROJECT