From f24ba41930242d5a10304874a6e8b1d9e0658447 Mon Sep 17 00:00:00 2001 From: Kroese Date: Thu, 8 Feb 2024 17:03:30 +0100 Subject: [PATCH] fix: Convert dashes in custom MAC addresses (#626) --- src/network.sh | 3 ++- src/power.sh | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/network.sh b/src/network.sh index fc15b66..fd4588e 100644 --- a/src/network.sh +++ b/src/network.sh @@ -216,7 +216,8 @@ getInfo() { VM_NET_MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:11:32:\3:\4:\5/') fi - VM_NET_MAC="${VM_NET_MAC,,//-/:}" + VM_NET_MAC="${VM_NET_MAC,,}" + VM_NET_MAC="${VM_NET_MAC//-/:}" if [[ ${#VM_NET_MAC} == 12 ]]; then m="$VM_NET_MAC" diff --git a/src/power.sh b/src/power.sh index bf22dfc..7757009 100644 --- a/src/power.sh +++ b/src/power.sh @@ -166,9 +166,12 @@ _graceful_shutdown() { finish "$code" && return "$code" } +PROCESS="${APP,,}" +PROCESS="${PROCESS// /-}" + MON_OPTS="\ -pidfile $QEMU_PID \ - -name ${APP,,// /-},process=${APP,,// /-},debug-threads=on \ + -name $PROCESS,process=$PROCESS,debug-threads=on \ -monitor telnet:localhost:$QEMU_PORT,server,nowait,nodelay" if [[ "$CONSOLE" != [Yy]* ]]; then