type shadowboxing, win compatibility

This commit is contained in:
iRaven 2024-02-21 02:10:55 -06:00
parent 279a7be3e7
commit 39449ac9a2
2 changed files with 9 additions and 3 deletions

View File

@ -2,6 +2,7 @@
"chkinterval": "",
"filepath": "",
"srcurl": "",
"os": "",
"server": "",
"port": "",
"ssh-user": "",

View File

@ -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