Unverified Commit 0543e868 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: Persistant MAC address (#445)

parent 73a063c6
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -239,8 +239,14 @@ getInfo() {
  fi

  if [ -z "$MAC" ]; then
    local file="$STORAGE/$PROCESS.mac"
    if [ -f "$file" ]; then
      MAC=$(<"$file")
    else
      # 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"
    fi
  fi

  VM_NET_MAC="${MAC^^}"