mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-01-09 14:28:03 +00:00
py-i2phosts-builder: require "hostsfile" to be defined
"hostsfile" should be defined by passing command-line option "-f" or using config option
This commit is contained in:
parent
7351534f88
commit
e48e67705f
@ -42,10 +42,13 @@ from web.lib.utils import validate_config
|
|||||||
validate_config(config)
|
validate_config(config)
|
||||||
|
|
||||||
# result hosts.txt
|
# result hosts.txt
|
||||||
if 'hostsfile' in config:
|
|
||||||
hostsfile = config['hostsfile']
|
|
||||||
if args.file:
|
if args.file:
|
||||||
hostsfile = args.file
|
hostsfile = args.file
|
||||||
|
elif config['hostsfile'] != None:
|
||||||
|
hostsfile = config['hostsfile']
|
||||||
|
else:
|
||||||
|
sys.stderr.write('Please specify "-f" or define "hostsfile" in config\n')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
f = open(hostsfile, 'w')
|
f = open(hostsfile, 'w')
|
||||||
# get activated hosts
|
# get activated hosts
|
||||||
|
Loading…
Reference in New Issue
Block a user