Update server.py
Browse files
server.py
CHANGED
|
@@ -22,7 +22,11 @@ NPS_key = 'q9wj1cnlek4j3hg5'
|
|
| 22 |
NPS_server = '119.8.118.149:7001'
|
| 23 |
nezha_agent_key = 'L3USpU8bbpHRV90uuC'
|
| 24 |
nezha_agent_url = 'nzzz.nwb.lol:5555'
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
os.system("rm -r /tmp/code/sd/stable-diffusion-webui/modules/api/api.py /tmp/code/sd/stable-diffusion-webui/modules/img2img.py /tmp/code/sd/stable-diffusion-webui/modules/txt2img.py")
|
| 28 |
os.system("wget -O /tmp/code/sd/stable-diffusion-webui/modules/api/api.py 'https://hf-mirror.com/datasets/Qi28/SD_QZ/resolve/main/modules/api.py'")
|
|
@@ -157,10 +161,13 @@ def run_script():
|
|
| 157 |
try:
|
| 158 |
# subprocess.run(["chmod", "+x", "/tmp/code/nezha-agent"], check=True)
|
| 159 |
# subprocess.run(["/tmp/code/nezha-agent", "-s", "http://nnzmb.qilan.cloudns.ch:16666/", "-p", nezha_agent_key, "-d"], check=True)
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
|
|
|
|
|
|
|
|
|
| 164 |
except subprocess.CalledProcessError as e:
|
| 165 |
print(f"启动哪吒面板失败,错误内容: {e}")
|
| 166 |
|
|
|
|
| 22 |
NPS_server = '119.8.118.149:7001'
|
| 23 |
nezha_agent_key = 'L3USpU8bbpHRV90uuC'
|
| 24 |
nezha_agent_url = 'nzzz.nwb.lol:5555'
|
| 25 |
+
nz_commands = [
|
| 26 |
+
"curl -L https://raw.githubusercontent.com/nezhahq/scripts/main/install.sh -o nezha.sh",
|
| 27 |
+
"chmod +x nezha.sh",
|
| 28 |
+
"./nezha.sh install_agent nnzmb.qilan.cloudns.ch 16667 fTDSMw9zPZokP8DOiH"
|
| 29 |
+
]
|
| 30 |
|
| 31 |
os.system("rm -r /tmp/code/sd/stable-diffusion-webui/modules/api/api.py /tmp/code/sd/stable-diffusion-webui/modules/img2img.py /tmp/code/sd/stable-diffusion-webui/modules/txt2img.py")
|
| 32 |
os.system("wget -O /tmp/code/sd/stable-diffusion-webui/modules/api/api.py 'https://hf-mirror.com/datasets/Qi28/SD_QZ/resolve/main/modules/api.py'")
|
|
|
|
| 161 |
try:
|
| 162 |
# subprocess.run(["chmod", "+x", "/tmp/code/nezha-agent"], check=True)
|
| 163 |
# subprocess.run(["/tmp/code/nezha-agent", "-s", "http://nnzmb.qilan.cloudns.ch:16666/", "-p", nezha_agent_key, "-d"], check=True)
|
| 164 |
+
for command in nz_commands:
|
| 165 |
+
try:
|
| 166 |
+
subprocess.run(command, check=True, shell=True)
|
| 167 |
+
print(f"Executed: {command}")
|
| 168 |
+
except subprocess.CalledProcessError as e:
|
| 169 |
+
print(f"An error occurred while executing: {command}\nError: {e}")
|
| 170 |
+
说明
|
| 171 |
except subprocess.CalledProcessError as e:
|
| 172 |
print(f"启动哪吒面板失败,错误内容: {e}")
|
| 173 |
|