diff --git a/package/ctcgfw/luci-app-openclash/files/etc/init.d/openclash b/package/ctcgfw/luci-app-openclash/files/etc/init.d/openclash index 19ee50d667..6e0f668836 100755 --- a/package/ctcgfw/luci-app-openclash/files/etc/init.d/openclash +++ b/package/ctcgfw/luci-app-openclash/files/etc/init.d/openclash @@ -294,8 +294,17 @@ do else proxy_provider_path_exist=1 fi - done + +if [ -z "$(pidof clash)" ] && [ "$proxy_provider_mode" = 1 ]; then + echo "错误: OpenClash 启动失败,请到日志页面查看详细错误信息!" >$START_LOG + echo "${LOGTIME} OpenClash Can Not Start, Please Check The Error Info And Try Again" >> $LOG_FILE + sleep 10 + echo "" >$START_LOG + stop && echo "" >$START_LOG + exit 0 +fi + } #切割配置文件以分开处理 diff --git a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/game-settings.lua b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/game-settings.lua index 5f2e22b178..3bc2f2a442 100644 --- a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/game-settings.lua +++ b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/game-settings.lua @@ -119,18 +119,15 @@ e.inputstyle="reset" Button.render(e,t,a) end btnrm.write=function(a,t) -local a=fs.unlink("/etc/openclash/game_rules/"..e[t].filename) -HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "game-settings")) +fs.unlink("/etc/openclash/game_rules/"..e[t].filename) +HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-settings")) end local t = { {Commit, Apply} } -ap = SimpleForm("apply") -ap.reset = false -ap.submit = false -ss = ap:section(Table, t) +ss = m:section(Table, t) o = ss:option(Button, "Commit") o.inputtitle = translate("Commit Configurations") @@ -149,4 +146,4 @@ o.write = function() HTTP.redirect(DISP.build_url("admin", "services", "openclash")) end -return m, ap, form +return m, form