From 8f337c8eb8b65a14a41e88f54b9a72f4e28455dc Mon Sep 17 00:00:00 2001 From: Kroese Date: Sat, 13 Apr 2024 23:30:28 +0200 Subject: [PATCH] fix: Ignore empty MAC address --- src/network.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/network.sh b/src/network.sh index 1666e9e..7c02760 100644 --- a/src/network.sh +++ b/src/network.sh @@ -251,9 +251,8 @@ getInfo() { if [ -z "$MAC" ]; then local file="$STORAGE/$PROCESS.mac" - if [ -f "$file" ]; then - MAC=$(<"$file") - else + [ -f "$file" ] && MAC=$(<"$file") + if [ -z "$MAC" ]; then # Generate MAC address based on Docker container ID in hostname MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/') echo "${MAC^^}" > "$file"