Эх сурвалжийг харах

temporary fix some device ucitrack not work

need to submit twice
rufengsuixing 5 жил өмнө
parent
commit
2b5869e83b

+ 6 - 0
luasrc/model/cbi/AdGuardHome/base.lua

@@ -247,4 +247,10 @@ o.write = function(self, section, value)
 	fs.writefile("/usr/share/AdGuardHome/links.txt", value:gsub("\r\n", "\n"))
 end
 fs.writefile("/var/run/lucilogpos","0")
+function m.on_commit(map)
+	if (fs.access("/var/run/AdGucitest")) then
+		io.popen("/etc/init.d/AdGuardHome reload &")
+	end
+	fs.writefile("/var/run/AdGucitest","")
+end
 return m

+ 6 - 0
luasrc/model/cbi/AdGuardHome/manual.lua

@@ -84,4 +84,10 @@ o.cfgvalue = function(self, section)
 end
 end
 end
+function m.on_commit(map)
+	if (fs.access("/var/run/AdGucitest")) then
+		io.popen("/etc/init.d/AdGuardHome reload &")
+	end
+	fs.writefile("/var/run/AdGucitest","")
+end
 return m

+ 2 - 1
root/etc/init.d/AdGuardHome

@@ -420,7 +420,8 @@ start_service() {
 	fi
 }
 reload_service()
-{
+{	
+	rm /var/run/AdGucitest 2>&1 >/dev/null
 	config_load "${CONFIGURATION}"
 	echo "AdGuardHome reloading"
 	config_get_bool enabled $CONFIGURATION enabled 0