diff --git a/package/gluon-manman-sync/luasrc/usr/bin/manman-sync b/package/gluon-manman-sync/luasrc/usr/bin/manman-sync index fad694b1..345c68e0 100755 --- a/package/gluon-manman-sync/luasrc/usr/bin/manman-sync +++ b/package/gluon-manman-sync/luasrc/usr/bin/manman-sync @@ -126,6 +126,11 @@ if uci:get_bool('gluon-manman-sync', 'sync', 'enabled') then print('Syncing with location ' .. location.location.name) + if uci:get('gluon-manman-sync', 'sync', 'last_data') and json.stringify(location) == uci:get('gluon-manman-sync', 'sync', 'last_data') then + print('Nothing changed, skipping sync') + return 0 + end + local owner = uci:get_first('gluon-node-info', 'owner') uci:set('gluon-node-info', owner, 'contact', location.administrator.email) local _location = uci:get_first('gluon-node-info', 'location') @@ -179,6 +184,8 @@ if uci:get_bool('gluon-manman-sync', 'sync', 'enabled') then uci:set('gluon-static-ip', net_mapped, 'ip4', cidr) end + uci:set('gluon-manman-sync', 'sync', 'last_data', json.stringify(location)) + uci:save('system') uci:save('gluon-manman-sync') uci:save('gluon-static-ip')