Skip to content

Commit 07d53ed

Browse files
committed
Silence FakeDns better
1 parent fbacb63 commit 07d53ed

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

start.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,13 @@ def toggle_dns_display():
260260
with open(FAKE_LOC, 'r+') as f:
261261
data = f.read()
262262
if DEBUG:
263-
if '# print ">> M' in data:
264-
data = data.replace('# print ">> M', 'print ">> M')
263+
if 'pass # print ">> M' in data:
264+
data = data.replace('pass # print ', 'print ')
265265
if not DEBUG:
266-
if '# print ">> M' not in data:
267-
data = data.replace('print ">> M', '# print ">> M')
266+
if 'pass # print ">> M' not in data:
267+
data = data.replace('your " \\\n "DNS Server."', 'your DNS Server."')
268+
data = data.replace('config path: \' \\\n \'./fakedns.py [configfile]\'', 'config path: ./fakedns.py [configfile]')
269+
data = data.replace('print ', 'pass # print ')
268270
f.seek(0)
269271
f.write(data)
270272
f.truncate()
@@ -304,9 +306,10 @@ def update_checker():
304306

305307
def startservers():
306308
"""Start the DNS and HTTP Server"""
307-
try:
309+
print('>> Starting FakeDns')
310+
if os.path.isfile(FAKE_LOC):
308311
dns = subprocess.Popen(['python', FAKE_LOC, '-c', DNS_LOC])
309-
except IOError:
312+
else:
310313
sys.exit('>> Unable to locate FakeDns')
311314

312315
try:

0 commit comments

Comments
 (0)