From 28f28c6eb95188805b9e0b3a64d12dd11d260c77 Mon Sep 17 00:00:00 2001 From: tigerbot Date: Fri, 3 Nov 2017 15:16:30 -0600 Subject: [PATCH] made DDNS care less when checking the gateway fails --- lib/ddns/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/ddns/index.js b/lib/ddns/index.js index c4a5d21..d089527 100644 --- a/lib/ddns/index.js +++ b/lib/ddns/index.js @@ -124,8 +124,17 @@ module.exports.create = function (deps, conf) { // Since we can't detect the OS level events when a user plugs in an ethernet cable to recheck // what network environment we are in we check our local network address and the gateway to // determine if we need to run the loopback check and router configuration again. - var gw = await network.getGatewayIpAsync(); var addr = await network.getPrivateIpAsync(); + // Until the author of the `network` package publishes the pull request we gave him + // checking the gateway on our units fails because we have the busybox versions of + // the linux commands. Gateway is realistically less important than address, so if + // we fail in getting it go ahead and use the null value. + var gw; + try { + gw = await network.getGatewayIpAsync(); + } catch (err) { + gw = null; + } if (localAddr === addr && gateway === gw) { return; }