Skip to content

Commit

Permalink
1.7.5.4a
Browse files Browse the repository at this point in the history
  • Loading branch information
frainzy1477 committed Jul 4, 2020
1 parent 8519e0b commit ca7230c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ define Package/$(PKG_NAME)/install
$(INSTALL_BIN) ./root/usr/share/rpcd/acl.d/luci-app-clash.json $(1)/usr/share/rpcd/acl.d
$(INSTALL_BIN) ./root/usr/share/clash/rules/g_rules/Steam.rules $(1)/usr/share/clash/rules/g_rules
$(INSTALL_BIN) ./root//usr/share/clash/rules/rules.list $(1)/usr/share/clash/rules


$(INSTALL_BIN) ./root/usr/share/clash/luci_version $(1)/usr/share/clash
$(INSTALL_BIN) ./root/usr/share/clash/rule.yaml $(1)/usr/share/clash
$(INSTALL_BIN) ./root/usr/share/clash/server.list $(1)/usr/share/clash
$(INSTALL_BIN) ./root/usr/share/clash/clash_real.txt $(1)/usr/share/clash
Expand Down
19 changes: 6 additions & 13 deletions luasrc/controller/clash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ local function localip()
return luci.sys.exec("uci get network.lan.ipaddr")
end

--local function check_version()
-- return luci.sys.exec("sh /usr/share/clash/check_luci_version.sh")
--end
local function check_version()
return luci.sys.exec("sh /usr/share/clash/check_luci_version.sh")
end

local function check_core()
return luci.sys.exec("sh /usr/share/clash/check_core_version.sh")
Expand All @@ -186,19 +186,12 @@ local function check_clashtun_core()
return luci.sys.exec("sh /usr/share/clash/check_clashtun_core_version.sh")
end

--local function current_version()
-- return luci.sys.exec("sed -n 1p /usr/share/clash/luci_version")
--end

--local function new_version()
-- return luci.sys.exec("sed -n 1p /usr/share/clash/new_luci_version")
--end
local function current_version()
return luci.sys.exec("opkg list-installed |grep 'luci-app-clash' |awk -F '- ' '{print $2}'")
return luci.sys.exec("sed -n 1p /usr/share/clash/luci_version")
end

local function new_version()
return luci.sys.exec("curl -sL "https://api.github.com/repos/frainzy1477/luci-app-clash/releases/latest" --connect-timeout 10| grep 'tag_name' | cut -d\" -f4")
return luci.sys.exec("sed -n 1p /usr/share/clash/new_luci_version")
end

local function new_core_version()
Expand Down Expand Up @@ -337,7 +330,7 @@ end
function check_status()
luci.http.prepare_content("application/json")
luci.http.write_json({
--check_version = check_version(),
check_version = check_version(),
check_core = check_core(),
current_version = current_version(),
check_clashr_core = check_clashr_core(),
Expand Down
2 changes: 1 addition & 1 deletion luasrc/view/clash/status.htm
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@



XHR.poll(3,'<%=luci.dispatcher.build_url("admin", "services", "clash", "check_status")%>', null, function(x, status) {});
XHR.poll(5,'<%=luci.dispatcher.build_url("admin", "services", "clash", "check_status")%>', null, function(x, status) {});

//]]></script>

Expand Down
2 changes: 1 addition & 1 deletion luasrc/view/clash/update.htm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
});


XHR.poll(3,'<%=luci.dispatcher.build_url("admin", "services", "clash", "check_status")%>', null, function(x, status) {});
XHR.poll(5,'<%=luci.dispatcher.build_url("admin", "services", "clash", "check_status")%>', null, function(x, status) {});


XHR.poll(1,'<%=luci.dispatcher.build_url("admin", "services", "clash", "status")%>', null, function(x, status) {
Expand Down
1 change: 1 addition & 0 deletions root/usr/share/clash/luci_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.7.5.4

0 comments on commit ca7230c

Please sign in to comment.