|
|
@@ -0,0 +1,15 @@
|
|
|
+set -e
|
|
|
+echo "[CONTAINER] agent-node-app-inibhjxchb"
|
|
|
+docker exec agent-node-app-inibhjxchb sh -c 'python3 - <<PY_END
|
|
|
+import hashlib, io, tarfile, tempfile, urllib.request, subprocess, sys, pathlib
|
|
|
+url="https://s3.fmode.cn/user/xhVRjTMwQH/chat/202612/xhvrjtmwqh-1796287895808-760717-fmode-onboarding-1.0.1-1fe6091811a33eb7.tar.gz"
|
|
|
+expected="1fe6091811a33eb796de7f09cd1e1c962b44cb3909550c685e28c0360fb81b76"
|
|
|
+data=urllib.request.urlopen(url,timeout=60).read(2097153)
|
|
|
+assert len(data)<=2097152 and hashlib.sha256(data).hexdigest()==expected, "sha mismatch"
|
|
|
+d=tempfile.mkdtemp(prefix="fmode-onboard-")
|
|
|
+with tarfile.open(fileobj=io.BytesIO(data),mode="r:gz") as a: a.extractall(d,filter="data")
|
|
|
+r=subprocess.run([sys.executable,str(pathlib.Path(d)/"install.py"),"--home","/opt/data"],capture_output=True,text=True)
|
|
|
+print(r.returncode, r.stdout[-500:], r.stderr[-800:])
|
|
|
+PY_END'
|
|
|
+docker exec agent-node-app-inibhjxchb /command/s6-svc -r /run/service/gateway-default || docker restart agent-node-app-inibhjxchb
|
|
|
+echo "[RESTARTED] agent-node-app-inibhjxchb"
|