From b3b6b14198fa752fc38286f19a11eb75a2abcf6b Mon Sep 17 00:00:00 2001 From: ShanStone <31815718+ShanStone@users.noreply.github.com> Date: Mon, 10 Oct 2022 21:38:27 +0800 Subject: [PATCH] luci-app-passwall: fix https://github.com/xiaorouji/openwrt-passwall/issues/2130 --- luci-app-passwall/root/usr/share/passwall/rule_update.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/luci-app-passwall/root/usr/share/passwall/rule_update.lua b/luci-app-passwall/root/usr/share/passwall/rule_update.lua index 57a3a401d..698fc9d28 100755 --- a/luci-app-passwall/root/usr/share/passwall/rule_update.lua +++ b/luci-app-passwall/root/usr/share/passwall/rule_update.lua @@ -92,10 +92,10 @@ end local function non_file_check(file_path, vali_file) if nixio.fs.readfile(file_path, 10) then - local remote_file_size = luci.sys.exec("cat " .. vali_file .. " | grep -i 'Content-Length' | awk '{print $2}'") - local local_file_size = nixio.fs.stat(file_path, "size") + local remote_file_size = tonumber(luci.sys.exec("cat " .. vali_file .. " | grep -i 'Content-Length' | awk '{print $2}'")) + local local_file_size = tonumber(nixio.fs.stat(file_path, "size")) if remote_file_size and local_file_size then - if tonumber(remote_file_size) == tonumber(local_file_size) then + if remote_file_size == local_file_size then return nil; else log("下载文件大小校验出错,原始文件大小" .. remote_file_size .. "B,下载文件大小:" .. local_file_size .. "B。")