Skip to content

Commit

Permalink
test it
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Apr 2, 2024
1 parent f29d009 commit 0b95ce1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ async function updateClients() {

const clientUpdates = existingClients.clients.map(async (client) => {
const macAddresses = client.ids.filter(id => isMacAddress(id));
console.log(`Checking client ${client.name} with macs: ${macAddresses}`)
if (macAddresses.length === 0) return

const originalClientIps = client.ids.filter(id => isIp(id));
Expand All @@ -84,6 +85,7 @@ async function updateClients() {

const updatedIds = [...new Set([...ipsForClient])];

console.log(`Client ${client.name} has IPs: ${updatedIds} and original IPs: ${originalClientIps} with macs: ${macAddresses}`)
if (!arraysEqual(originalClientIps, updatedIds)) {
client.ids = [...updatedIds, ...new Set([...client.ids.filter(id => !isIp(id))])];
const updateObj = {
Expand Down

0 comments on commit 0b95ce1

Please sign in to comment.