-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (24 loc) · 951 Bytes
/
main.py
File metadata and controls
36 lines (24 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import subprocess
import time
import os
def main():
print("CDN System Starting...")
cwd = os.path.dirname(os.path.abspath(__file__))
def start_in_new_terminal(title, command):
full_cmd = f'start "{title}" cmd /k "cd /d {cwd} && python {command}"'
subprocess.Popen(full_cmd, shell=True)
processes = []
print("\n[1/4] Starting Monitor Server...")
start_in_new_terminal("Monitor Server", "monitor_server.py")
time.sleep(2)
print("[2/4] Starting Index Server...")
start_in_new_terminal("Index Server", "index_server.py")
time.sleep(2)
print("[3/4] Starting Content Server 1...")
start_in_new_terminal("Content Server 1", "start_server1.py")
time.sleep(1)
print("[4/4] Starting Content Server 2...")
start_in_new_terminal("Content Server 2", "start_server2.py")
print("\nAll servers started!")
if __name__ == '__main__':
main()