From 4bbf9c28859b67bac8a4a8899b0692042c415039 Mon Sep 17 00:00:00 2001 From: clamsawd Date: Thu, 29 Oct 2015 16:56:05 +0100 Subject: [PATCH] Replaced the native commands to remove (os.remove()) --- ip2e-config.py | 5 +---- ip2e-daemon.py | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ip2e-config.py b/ip2e-config.py index a022411..7c52000 100755 --- a/ip2e-config.py +++ b/ip2e-config.py @@ -71,10 +71,7 @@ def writeip2ecf(): ip2ecf.write('ToEmail="'+ToEmail+'"\n') ip2ecf.close() -if os.name == "posix": - os.system("rm ip2e-conf.py") -elif os.name == "nt": - os.system("del ip2e-conf.py") +os.remove("ip2e-conf.py") createip2ecf() writeip2ecf() exec(open("ip2e-conf.py").read()) diff --git a/ip2e-daemon.py b/ip2e-daemon.py index 8286ada..35767a3 100755 --- a/ip2e-daemon.py +++ b/ip2e-daemon.py @@ -239,10 +239,7 @@ while PublicIP <= 2: os.system("echo "+MailMessage+" to "+ToEmail+" >> ip2e.log") os.system("echo [ip2e-daemon] ["+CurrentTime+"] Retrying in 5 seconds... >> ip2e.log") time.sleep(5) - if os.name == "posix": - os.system("rm current-ip.py") - elif os.name == "nt": - os.system("del current-ip.py") + os.remove("current-ip.py") def createNewip2eIPcf(): ip2eIPcf=open('current-ip.py','w') ip2eIPcf.close()