From 47c480f059d9c9e4cc91b848a8f3b00a2e96552e Mon Sep 17 00:00:00 2001 From: catborise Date: Sun, 4 Oct 2026 00:27:55 +0300 Subject: [PATCH] fix(bootstrap): the compute bootstrap script parses again The quoting of the tr argument in the /etc/os-release parsing put the closing parenthesis inside a single-quoted string, so sh and bash stopped with "unexpected EOF while looking for matching )" before doing anything: 'curl ... | sudo sh' failed on every distribution. It is now tr -d "\"'"; bash -n and shellcheck -S error pass. Also drops the spice_listen edits of qemu.conf; only VNC is used. --- dev/libvirt-bootstrap.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/dev/libvirt-bootstrap.sh b/dev/libvirt-bootstrap.sh index 68c85ca6..3f12d89c 100644 --- a/dev/libvirt-bootstrap.sh +++ b/dev/libvirt-bootstrap.sh @@ -223,8 +223,8 @@ __gather_linux_system_info() { done < /etc/"${rsource}" ;; os ) - nn=$(grep '^ID=' /etc/os-release | sed -e 's/^ID=\(.*\)$/\1/g' | tr -d '"'\'') - rv=$(grep '^VERSION_ID=' /etc/os-release | sed -e 's/^VERSION_ID=\(.*\)$/\1/g' | tr -d '"'\'') + nn=$(grep '^ID=' /etc/os-release | sed -e 's/^ID=\(.*\)$/\1/g' | tr -d "\"'") + rv=$(grep '^VERSION_ID=' /etc/os-release | sed -e 's/^VERSION_ID=\(.*\)$/\1/g' | tr -d "\"'") [ "${rv}x" != "x" ] && v=$(__parse_version_string "$rv") || v="" case $(echo "${nn}" | tr '[:upper:]' '[:lower:]') in arch ) @@ -410,7 +410,6 @@ install_centos_post() { fi if [ -f /etc/libvirt/qemu.conf ]; then sed -i 's/#[ ]*vnc_listen.*/vnc_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf - sed -i 's/#[ ]*spice_listen.*/spice_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf else echoerror "/etc/libvirt/qemu.conf not found. Exiting..." exit 1 @@ -512,7 +511,6 @@ install_fedora_post() { fi if [ -f /etc/libvirt/qemu.conf ]; then sed -i 's/#[ ]*vnc_listen.*/vnc_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf - sed -i 's/#[ ]*spice_listen.*/spice_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf else echoerror "/etc/libvirt/qemu.conf not found. Exiting..." exit 1 @@ -581,7 +579,6 @@ install_opensuse_post() { fi if [ -f /etc/libvirt/qemu.conf ]; then sed -i 's/#[ ]*vnc_listen.*/vnc_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf - sed -i 's/#[ ]*spice_listen.*/spice_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf fi mkdir -p /etc/supervisord.d /etc/supervisor/conf.d if [ -f /etc/supervisord.conf ] || [ -f /etc/supervisor/supervisord.conf ]; then @@ -650,7 +647,6 @@ install_ubuntu_post() { fi if [ -f /etc/libvirt/qemu.conf ]; then sed -i 's/#[ ]*vnc_listen.*/vnc_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf - sed -i 's/#[ ]*spice_listen.*/spice_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf else echoerror "/etc/libvirt/qemu.conf not found. Exiting..." @@ -730,7 +726,6 @@ install_debian_post() { fi if [ -f /etc/libvirt/qemu.conf ]; then sed -i 's/#[ ]*vnc_listen.*/vnc_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf - sed -i 's/#[ ]*spice_listen.*/spice_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf else echoerror "/etc/libvirt/qemu.conf not found. Exiting..." exit 1