luci-app-openclash: sync with upstream source

This commit is contained in:
CN_SZTL 2020-02-16 21:21:37 +08:00
parent e4eecb987c
commit e59a145234
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
3 changed files with 11 additions and 11 deletions

View File

@ -129,7 +129,7 @@ end
end
local function corelv()
local new = luci.sys.exec("sh /usr/share/openclash/clash_version.sh")
local new = luci.sys.call(string.format("sh /usr/share/openclash/clash_version.sh"))
local core_lv = luci.sys.exec("sed -n 1p /tmp/clash_last_version 2>/dev/null")
return core_lv..","..new
end

View File

@ -37,28 +37,28 @@ function config_check(CONFIG_FILE)
end
if yaml then
if (proxy == 0) then
proxy = 0
proxy = ""
else
if (proxy_provier == 0) then
proxy = 0
proxy = ""
else
proxy = " - 代理服务器"
end
end
if (group == 0) then
group = 0
group = ""
else
group = " - 策略组"
end
if (rule == 0) then
rule = 0
rule = ""
else
rule = " - 规则"
end
if proxy and group and rule then
if (proxy=="") and (group=="") and (rule=="") then
return "Config Normal"
else
return proxy..group..rule.."部分异常"
return proxy..group..rule.." - 部分异常"
end
elseif (yaml ~= 0) then
return "配置文件不存在"

View File

@ -1,9 +1,9 @@
#!/bin/sh
CKTIME=$(date "+%Y-%m-%d-%H")
LAST_OPVER="/tmp/clash_last_version"
LAST_VER=$(sed -n 1p "$LAST_OPVER" 2>/dev/null |awk -F '-' '{print $1$2}' |sed -i "s/v//" |sed -i "s/.//")
CLASH_VERF=$(echo "/etc/openclash/clash -v 2>/dev/null" && awk -F ' ' '{print $2}')
CLASH_VER=$(echo "$CLASH_VERF" 2>/dev/null |awk -F ' ' '{print $2}' |awk -F '-' '{print $1$2}' |sed -i "s/v//" |sed -i "s/.//")
LAST_VER=$(sed -n 1p "$LAST_OPVER" 2>/dev/null |awk -F '-' '{print $1$2}' 2>/dev/null |awk -F '.' '{print $2$3}' 2>/dev/null)
CLASH_VERF=$(/etc/openclash/clash -v 2>/dev/null)
CLASH_VER=$(echo "$CLASH_VERF" 2>/dev/null |awk -F ' ' '{print $2}' 2>/dev/null |awk -F '-' '{print $1$2}' 2>/dev/null |awk -F '.' '{print $2$3}' 2>/dev/null)
version_url="https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version"
if [ "$CKTIME" != "$(grep "CheckTime" $LAST_OPVER 2>/dev/null |awk -F ':' '{print $2}')" ]; then
curl -sL --connect-timeout 10 --retry 2 "$version_url" -o $LAST_OPVER >/dev/null 2>&1
@ -15,4 +15,4 @@ if [ "$CKTIME" != "$(grep "CheckTime" $LAST_OPVER 2>/dev/null |awk -F ':' '{prin
fi
if [ "$LAST_VER" -gt "$CLASH_VER" ]; then
return 2
fi
fi 2>/dev/null