Forcing to create the configuration file

This commit is contained in:
clamsawd 2015-11-06 17:44:24 +01:00
parent 363a101026
commit b930ce5fe9
2 changed files with 7 additions and 29 deletions

View File

@ -55,18 +55,13 @@ if os.path.exists(".ip2e"):
if os.path.isfile("ip2e-conf.py"):
print ("ip2e-conf.py exists")
else:
print ("ip2e-conf.py created")
ip2ecf=open('ip2e-conf.py','w')
ip2ecf.close()
ip2ecf=open('ip2e-conf.py','a')
ip2ecf.write('# sample configuration file of ip2e\n')
ip2ecf.write('\n')
ip2ecf.write('FromEmail="ip2e@daemon"\n')
ip2ecf.write('FromEmailUser="unknown"\n')
ip2ecf.write('FromEmailPass="password-here"\n')
ip2ecf.write('SmtpFromEmail="smtp.email.com"\n')
ip2ecf.write('ToEmail="unknown@email.com"\n')
ip2ecf.close()
ClearScreen()
print ("")
print ("The configuration file doesn't exist")
print ("")
print ("You can create it if you run 'ip2e-config.py'")
print ("")
exit(0)
#Check if exists 'current-ip.py'
if os.path.isfile("current-ip.py"):

View File

@ -47,23 +47,6 @@ if not os.path.exists(".ip2e"):
if os.path.exists(".ip2e"):
os.chdir(".ip2e")
#Check if exists 'ip2e-conf.py'
if os.path.isfile("ip2e-conf.py"):
print ("ip2e-conf.py exists")
else:
print ("ip2e-conf.py created")
ip2ecf=open('ip2e-conf.py','w')
ip2ecf.close()
ip2ecf=open('ip2e-conf.py','a')
ip2ecf.write('# sample configuration file of ip2e\n')
ip2ecf.write('\n')
ip2ecf.write('FromEmail="ip2e@daemon"\n')
ip2ecf.write('FromEmailUser="unknown"\n')
ip2ecf.write('FromEmailPass="password-here"\n')
ip2ecf.write('SmtpFromEmail="smtp.email.com"\n')
ip2ecf.write('ToEmail="unknown@email.com"\n')
ip2ecf.close()
#See the log file
if os.path.isfile("ip2e.log"):
print ("ip2e.log exists")