Mattraks vor 5 Jahren
Ursprung
Commit
1d019e5b28
1 geänderte Dateien mit 18 neuen und 18 gelöschten Zeilen
  1. 18 18
      luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua

+ 18 - 18
luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua

@@ -418,24 +418,24 @@ local execute = function()
 		-- 如果原有服务器节点已经不见了就尝试换为第一个节点
 		local globalServer = ucic:get_first(name, 'global', 'global_server', '')
 		if globalServer ~= "nil" then
-      local firstServer = ucic:get_first(name, uciType)
-      if firstServer then
-        if not ucic:get(name, globalServer) then
-          luci.sys.call("/etc/init.d/" .. name .. " stop > /dev/null 2>&1 &")
-          ucic:commit(name)
-          ucic:set(name, ucic:get_first(name, 'global'), 'global_server', ucic:get_first(name, uciType))
-          ucic:commit(name)
-          log('当前主服务器节点已被删除,正在自动更换为第一个节点。')
-          luci.sys.call("/etc/init.d/" .. name .. " start > /dev/null 2>&1 &")
-        else
-          log('维持当前主服务器节点。')
-          luci.sys.call("/etc/init.d/" .. name .." restart > /dev/null 2>&1 &")
-        end
-      else
-        log('没有服务器节点了,停止服务')
-        luci.sys.call("/etc/init.d/" .. name .. " stop > /dev/null 2>&1 &")
-      end
-    end
+			local firstServer = ucic:get_first(name, uciType)
+			if firstServer then
+				if not ucic:get(name, globalServer) then
+					luci.sys.call("/etc/init.d/" .. name .. " stop > /dev/null 2>&1 &")
+					ucic:commit(name)
+					ucic:set(name, ucic:get_first(name, 'global'), 'global_server', ucic:get_first(name, uciType))
+					ucic:commit(name)
+					log('当前主服务器节点已被删除,正在自动更换为第一个节点。')
+					luci.sys.call("/etc/init.d/" .. name .. " start > /dev/null 2>&1 &")
+				else
+					log('维持当前主服务器节点。')
+					luci.sys.call("/etc/init.d/" .. name .." restart > /dev/null 2>&1 &")
+				end
+			else
+				log('没有服务器节点了,停止服务')
+				luci.sys.call("/etc/init.d/" .. name .. " stop > /dev/null 2>&1 &")
+			end
+		end
 		log('新增节点数量: ' ..add, '删除节点数量: ' .. del)
 		log('订阅更新成功')
 	end