浏览代码

fix terminaled bug

rufengsuixing 5 年之前
父节点
当前提交
ad49d8f1fb
共有 1 个文件被更改,包括 1 次插入5 次删除
  1. 1 5
      luasrc/model/cbi/AdGuardHome/manual.lua

+ 1 - 5
luasrc/model/cbi/AdGuardHome/manual.lua

@@ -26,7 +26,6 @@ function gen_template_config()
 	return table.concat(tbl, "\n")
 end
 m = Map("AdGuardHome")
-
 local escconf = uci:get("AdGuardHome","AdGuardHome","configpath")
 local binpath = uci:get("AdGuardHome","AdGuardHome","binpath")
 s = m:section(TypedSection, "AdGuardHome")
@@ -50,6 +49,7 @@ o.validate=function(self, value)
 end
 o.write = function(self, section, value)
 	NXFS.move("/tmp/AdGuardHometmpconfig.yaml",escconf)
+	io.popen("sleep 1 ;/etc/init.d/AdGuardHome reload & ;")
 end
 o.remove = function(self, section, value)
 	NXFS.writefile(escconf, "")
@@ -76,9 +76,5 @@ luci.http.redirect(luci.dispatcher.build_url("admin","services","AdGuardHome","m
 end
 end
 end
-local apply = luci.http.formvalue("cbi.apply")
- if apply then
-     io.popen("/etc/init.d/AdGuardHome reload &")
-end
 
 return m