From 3f3b921967e02d7c432a6805061b234d6b66c851 Mon Sep 17 00:00:00 2001 From: remittor Date: Fri, 14 Feb 2025 12:19:12 +0300 Subject: [PATCH] gateway: Fix get md5sum of file --- gateway.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gateway.py b/gateway.py index 973bbf4..d3b5a0a 100644 --- a/gateway.py +++ b/gateway.py @@ -923,8 +923,8 @@ class Gateway(): num = str(random.randint(10000, 1000000)) md5_local_fn = f"tmp/{fname}.{num}.md5" md5_remote_fn = f"/tmp/{fname}.{num}.md5" - cmd = f'md5sum "{fn_remote}" &> "{md5_remote_fn}" ' - rc = self.run_cmd(cmd, timeout = 4) + cmd = f'md5sum "{fn_remote}" > "{md5_remote_fn}" 2>&1' + rc = self.run_cmd(cmd, timeout = 5) if not rc: return -5 os.remove(md5_local_fn) if os.path.exists(md5_local_fn) else None