mirror of
https://github.com/brian8544/turtle-wow.git
synced 2024-12-28 10:24:36 +00:00
30 lines
707 B
Python
30 lines
707 B
Python
|
from werkzeug.wrappers import Request, Response
|
||
|
from threading import Thread
|
||
|
import subprocess
|
||
|
import time
|
||
|
|
||
|
class DeployWorker(Thread):
|
||
|
def __init__(self):
|
||
|
Thread.__init__(self)
|
||
|
self.deploy = False
|
||
|
|
||
|
def run(self):
|
||
|
while True:
|
||
|
if self.deploy:
|
||
|
self.deploy = False
|
||
|
subprocess.call(["/bin/bash", "/root/LegacyPlayersV3/Deploy/deploy.sh"])
|
||
|
else:
|
||
|
time.sleep(1)
|
||
|
|
||
|
|
||
|
globalThread = 0
|
||
|
@Request.application
|
||
|
def application(request):
|
||
|
globalThread.deploy = True
|
||
|
return Response("Ok!")
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
globalThread = DeployWorker()
|
||
|
globalThread.start()
|
||
|
from werkzeug.serving import run_simple
|
||
|
run_simple("0.0.0.0", 55555, application)
|