mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-02 21:53:56 +08:00
update 2026-08-28 02:44:45
This commit is contained in:
1 parent
9a3f194de9
commit
587815b344
25 files changed
+143
-250
No files matched your search
@@ -69,13 +69,6 @@ local function convert_geofile()
|
||||
end
|
||||
local function convert(file_path, prefix, tags)
|
||||
if next(tags) and fs.access(file_path) then
|
||||
local md5_file = GEO_VAR.TO_SRS_PATH .. prefix .. ".dat.md5"
|
||||
local new_md5 = sys.exec("md5sum " .. file_path .. " 2>/dev/null | awk '{print $1}'"):gsub("\n", "")
|
||||
local old_md5 = sys.exec("[ -f " .. md5_file .. " ] && head -n 1 " .. md5_file .. " | tr -d ' \t\n' || echo ''")
|
||||
if new_md5 ~= "" and new_md5 ~= old_md5 then
|
||||
sys.call("printf '%s' " .. new_md5 .. " > " .. md5_file)
|
||||
sys.call("rm -rf " .. GEO_VAR.TO_SRS_PATH .. prefix .. "-*.srs" )
|
||||
end
|
||||
for k in pairs(tags) do
|
||||
geo_convert_srs({["geo_path"] = file_path, ["prefix"] = prefix, ["rule_name"] = k})
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user