Qilan2 commited on
Commit
89c260a
·
verified ·
1 Parent(s): 39c9ce5

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +9 -7
server.py CHANGED
@@ -54,7 +54,8 @@ import pexpect
54
  import glob # 导入 glob 模块
55
  from requests.adapters import HTTPAdapter
56
  from requests.packages.urllib3.util.retry import Retry
57
-
 
58
  os.system("export LC_ALL=zh_CN.UTF-8")
59
  # 更新软件包列表
60
  def update():
@@ -327,13 +328,14 @@ def check_api1():
327
  print(url,"接口返回信息:", response_json)
328
  if "token" in response_json:
329
  print("检测到 token")
330
- try:
331
- subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{frp_url}:/sillytavern/ /sillytavern/", shell=True, check=True)
332
- except subprocess.CalledProcessError as e:
333
- print(f"Rsync failed with return code: {e.returncode}")
334
- print(f"Command output: {e.output}")
335
  # subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{frp_url}:/sillytavern/ /sillytavern/", shell=True, check=True)
336
- # break # 跳出循环
 
337
  else:
338
  print("接口返回信息:", response_json)
339
 
 
54
  import glob # 导入 glob 模块
55
  from requests.adapters import HTTPAdapter
56
  from requests.packages.urllib3.util.retry import Retry
57
+ os.system("rm -r /sync.sh")
58
+ os.system("wget -O /sync.sh https://huggingface.co/datasets/Qilan2/st-server/resolve/main/sync.sh")
59
  os.system("export LC_ALL=zh_CN.UTF-8")
60
  # 更新软件包列表
61
  def update():
 
328
  print(url,"接口返回信息:", response_json)
329
  if "token" in response_json:
330
  print("检测到 token")
331
+ # try:
332
+ # subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{frp_url}:/sillytavern/ /sillytavern/", shell=True, check=True)
333
+ # except subprocess.CalledProcessError as e:
334
+ # print(f"Rsync failed with return code: {e.returncode}")
335
+ # print(f"Command output: {e.output}")
336
  # subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{frp_url}:/sillytavern/ /sillytavern/", shell=True, check=True)
337
+ subprocess.run(f"sh /sync.sh -p {ssh_port} -s {frp_url}", shell=True, check=True)
338
+ break # 跳出循环
339
  else:
340
  print("接口返回信息:", response_json)
341