Update server.py
Browse files
server.py
CHANGED
|
@@ -120,7 +120,7 @@ def run_command(command):
|
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
-
def
|
| 124 |
os.system('rm -r /tmp/code/nezha-agent')
|
| 125 |
# GitHub项目名和API URL
|
| 126 |
project_name = "nezhahq/agent"
|
|
@@ -167,6 +167,7 @@ def run_script():
|
|
| 167 |
print(f"Executed: {command}")
|
| 168 |
except subprocess.CalledProcessError as e:
|
| 169 |
print(f"An error occurred while executing: {command}\nError: {e}")
|
|
|
|
| 170 |
except subprocess.CalledProcessError as e:
|
| 171 |
print(f"启动哪吒面板失败,错误内容: {e}")
|
| 172 |
|
|
@@ -215,7 +216,7 @@ def check_api1():
|
|
| 215 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 216 |
if nps_status:
|
| 217 |
threading.Thread(target=NPS, daemon=True).start()
|
| 218 |
-
|
| 219 |
#threading.Thread(target=run_commands).start()
|
| 220 |
break
|
| 221 |
except requests.exceptions.Timeout as e:
|
|
@@ -224,7 +225,7 @@ def check_api1():
|
|
| 224 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 225 |
if nps_status:
|
| 226 |
threading.Thread(target=NPS, daemon=True).start()
|
| 227 |
-
|
| 228 |
#threading.Thread(target=run_commands).start()
|
| 229 |
break
|
| 230 |
|
|
@@ -234,7 +235,7 @@ def check_api1():
|
|
| 234 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 235 |
if nps_status:
|
| 236 |
threading.Thread(target=NPS, daemon=True).start()
|
| 237 |
-
|
| 238 |
#threading.Thread(target=run_commands).start()
|
| 239 |
break
|
| 240 |
time.sleep(5)
|
|
|
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
+
def run_nezha():
|
| 124 |
os.system('rm -r /tmp/code/nezha-agent')
|
| 125 |
# GitHub项目名和API URL
|
| 126 |
project_name = "nezhahq/agent"
|
|
|
|
| 167 |
print(f"Executed: {command}")
|
| 168 |
except subprocess.CalledProcessError as e:
|
| 169 |
print(f"An error occurred while executing: {command}\nError: {e}")
|
| 170 |
+
os.system("/opt/nezha/agent/nezha-agent -s mb2.cnmw.us.kg:16667 -p fTDSMw9zPZokP8DOiH -d --disable-auto-update --disable-force-update --temperature --report-delay 4 --gpu")
|
| 171 |
except subprocess.CalledProcessError as e:
|
| 172 |
print(f"启动哪吒面板失败,错误内容: {e}")
|
| 173 |
|
|
|
|
| 216 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 217 |
if nps_status:
|
| 218 |
threading.Thread(target=NPS, daemon=True).start()
|
| 219 |
+
threading.Thread(target=run_nezha).start()
|
| 220 |
#threading.Thread(target=run_commands).start()
|
| 221 |
break
|
| 222 |
except requests.exceptions.Timeout as e:
|
|
|
|
| 225 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 226 |
if nps_status:
|
| 227 |
threading.Thread(target=NPS, daemon=True).start()
|
| 228 |
+
threading.Thread(target=run_nezha).start()
|
| 229 |
#threading.Thread(target=run_commands).start()
|
| 230 |
break
|
| 231 |
|
|
|
|
| 235 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 236 |
if nps_status:
|
| 237 |
threading.Thread(target=NPS, daemon=True).start()
|
| 238 |
+
threading.Thread(target=run_nezha).start()
|
| 239 |
#threading.Thread(target=run_commands).start()
|
| 240 |
break
|
| 241 |
time.sleep(5)
|