Skip to content

Commit

Permalink
fix #295
Browse files Browse the repository at this point in the history
  • Loading branch information
aa65535 committed Sep 13, 2022
1 parent 3169c14 commit f0e7a9e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions files/root/usr/bin/ss-subscribe
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ end
function table_equal(t1, t2)
for k, v in pairs(t1) do
if "table" == type(v) then
return table_equal(v, t2[k])
if not table_equal(v, t2[k]) then
return false
end
else
if v ~= t2[k] then
return false
Expand Down Expand Up @@ -199,11 +201,9 @@ if #arg > 0 then
end
local changes = uci:changes(config)
if #changes > 0 then
local current = get_current_servers()
if table_equal(servers, current) then
uci:revert(config)
else
if uci:commit(config) then
if uci:commit(config) then
local current = get_current_servers()
if not table_equal(servers, current) then
os.execute("/etc/init.d/%s restart" %{config})
end
end
Expand Down

0 comments on commit f0e7a9e

Please sign in to comment.