mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
libvirt-guest.init: handle domain name with spaces
awk splits the line on consecutive spaces, which breaks getting the name of a domain whose name contains spaces. Use sed instead to strip the "Name:" prefix from the line Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
parent
a757e60a07
commit
2bbda1444d
@ -105,7 +105,7 @@ guest_name() {
|
||||
uuid=$2
|
||||
|
||||
name=$(run_virsh_c $uri dominfo $uuid 2>/dev/null | \
|
||||
awk '/^Name:/{print $2}')
|
||||
sed -ne 's/^Name: *//p')
|
||||
[ -n "$name" ] || name=$uuid
|
||||
|
||||
echo "$name"
|
||||
|
Loading…
x
Reference in New Issue
Block a user