forked from IDeletedSystem64/iptables-deploy
type shadowboxing, win compatibility
This commit is contained in:
parent
279a7be3e7
commit
39449ac9a2
@ -2,6 +2,7 @@
|
||||
"chkinterval": "",
|
||||
"filepath": "",
|
||||
"srcurl": "",
|
||||
"os": "",
|
||||
"server": "",
|
||||
"port": "",
|
||||
"ssh-user": "",
|
||||
|
11
deploy.py
11
deploy.py
@ -18,7 +18,11 @@ shcommands = []
|
||||
|
||||
def healthcheck():
|
||||
global healthstatus
|
||||
response = os.system("ping -c 2 " + cfg["server"] + ">> /dev/null")
|
||||
response = ""
|
||||
if cfg["os"] == "win":
|
||||
response = os.system("ping -n 2 " + cfg["server"])
|
||||
else:
|
||||
response = os.system("ping -c 2 " + cfg["server"] + ">> /dev/null")
|
||||
if response != 0:
|
||||
healthstatus = "err"
|
||||
else:
|
||||
@ -68,5 +72,6 @@ while True:
|
||||
deploy()
|
||||
break
|
||||
else:
|
||||
print("Got a response! health status is ok.")
|
||||
time.sleep(cfg["chkinterval"]) # we will run this loop every X seconds, defined by checkinterval
|
||||
print("Got a response! health status is ok.")
|
||||
print("Trying again in " + cfg["chkinterval"] + " seconds.")
|
||||
time.sleep(int(cfg["chkinterval"])) # we will run this loop every X seconds, defined by checkinterval
|
||||
|
Loading…
x
Reference in New Issue
Block a user