Skip to content

Commit

Permalink
fix: Gracefully handle development on systems with bonded network int…
Browse files Browse the repository at this point in the history
…erfaces
  • Loading branch information
Hypfer committed Jan 16, 2024
1 parent 183c87e commit 9969307
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/lib/utils/LinuxTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LinuxTools {
const interfaces = fs.readdirSync("/sys/class/net");
const macAddresses = new Set();

interfaces.forEach(i => {
interfaces.filter(i => i !== "bonding_masters").forEach(i => {
const mac = fs.readFileSync(`/sys/class/net/${i}/address`).toString().trim();

if (!mac.startsWith("00:00")) {
Expand Down Expand Up @@ -97,7 +97,7 @@ class LinuxTools {
}

/**
*
*
* @returns {string | undefined}
*/
static GET_GATEWAY_IP() {
Expand Down

1 comment on commit 9969307

@xuefer
Copy link
Contributor

@xuefer xuefer commented on 9969307 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, it looks better than my try/catch block

Please sign in to comment.