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