mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 05:20:02 +08:00
fix: Ignore empty MAC address (#688)
This commit is contained in:
parent
64e2af9fa2
commit
5015597183
@ -6,7 +6,10 @@
|
|||||||
.gitmodules
|
.gitmodules
|
||||||
Dockerfile
|
Dockerfile
|
||||||
Dockerfile.archive
|
Dockerfile.archive
|
||||||
|
compose.yml
|
||||||
|
compose.yaml
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
|
docker-compose.yaml
|
||||||
|
|
||||||
*.md
|
*.md
|
||||||
|
|
||||||
|
@ -228,9 +228,8 @@ getInfo() {
|
|||||||
|
|
||||||
if [ -z "$VM_NET_MAC" ]; then
|
if [ -z "$VM_NET_MAC" ]; then
|
||||||
local file="$STORAGE/dsm.mac"
|
local file="$STORAGE/dsm.mac"
|
||||||
if [ -f "$file" ]; then
|
[ -f "$file" ] && VM_NET_MAC=$(<"$file")
|
||||||
VM_NET_MAC=$(<"$file")
|
if [ -z "$VM_NET_MAC" ]; then
|
||||||
else
|
|
||||||
# Generate MAC address based on Docker container ID in hostname
|
# Generate MAC address based on Docker container ID in hostname
|
||||||
VM_NET_MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:11:32:\3:\4:\5/')
|
VM_NET_MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:11:32:\3:\4:\5/')
|
||||||
echo "${VM_NET_MAC^^}" > "$file"
|
echo "${VM_NET_MAC^^}" > "$file"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user