fix: Lowercase MAC address (#407)

This commit is contained in:
Kroese 2024-01-30 04:29:29 +01:00 committed by GitHub
parent 46867564df
commit 2d0f169892
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -239,11 +239,11 @@ getInfo() {
fi fi
if [ -z "$MAC" ]; then if [ -z "$MAC" ]; then
# Generate MAC address based on hostname # Generate MAC address based on Docker container ID in hostname
MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/') MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
fi fi
VM_NET_MAC="${MAC//-/:}" VM_NET_MAC="${MAC,,//-/:}"
if [[ ${#VM_NET_MAC} == 12 ]]; then if [[ ${#VM_NET_MAC} == 12 ]]; then
m="$VM_NET_MAC" m="$VM_NET_MAC"