mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 13:45:13 +08:00
🐤 Sync 2026-09-08 23:54:39
This commit is contained in:
1 parent
4df4ad7d50
commit
6d2e39ca12
18 files changed
+68
-49
No files matched your search
@@ -1378,11 +1378,22 @@ function to_move(app_name,file)
|
||||
end
|
||||
|
||||
function get_version()
|
||||
local version = sys.exec("opkg list-installed luci-app-passwall 2>/dev/null | awk '{print $3}'")
|
||||
if not version or #version == 0 then
|
||||
version = sys.exec("apk list luci-app-passwall 2>/dev/null | awk '/installed/ {print $1}' | cut -d'-' -f4-")
|
||||
local version
|
||||
local version_file = CACHE_PATH .. "/passwall_version"
|
||||
sys.call("mkdir -p " .. CACHE_PATH)
|
||||
if fs.access(version_file) then
|
||||
version = fs.readfile(version_file)
|
||||
else
|
||||
version = sys.exec("opkg list-installed luci-app-passwall 2>/dev/null | awk '{print $3}'")
|
||||
if not version or version == "" then
|
||||
version = sys.exec("apk list luci-app-passwall 2>/dev/null | awk '/installed/ {print $1}' | cut -d'-' -f4-")
|
||||
end
|
||||
version = (version or ""):match("^%s*(.-)%s*$")
|
||||
if version ~= "" then
|
||||
fs.writefile(version_file, version)
|
||||
end
|
||||
end
|
||||
return (version or ""):gsub("\n", ""):match("^([^-]+)")
|
||||
return version:match("^([^-]+)") or ""
|
||||
end
|
||||
|
||||
function to_check_self()
|
||||
|
||||
Reference in new issue
Block a user