diff --git a/conf-template.json b/conf-template.json index 669be27..6ac4485 100644 --- a/conf-template.json +++ b/conf-template.json @@ -2,6 +2,7 @@ "chkinterval": "", "filepath": "", "srcurl": "", + "os": "", "server": "", "port": "", "ssh-user": "", diff --git a/deploy.py b/deploy.py index 97d14c3..1c0e485 100644 --- a/deploy.py +++ b/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