From ec9142bf27d603d2030628d1029c8c7a7852d059 Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Sun, 31 Dec 2023 07:49:25 +0100 Subject: [PATCH] fix: pci regain with invalid syntax --- salt/dom0/files/bin/qvm-pci-regain | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/salt/dom0/files/bin/qvm-pci-regain b/salt/dom0/files/bin/qvm-pci-regain index 4274590..86a7536 100755 --- a/salt/dom0/files/bin/qvm-pci-regain +++ b/salt/dom0/files/bin/qvm-pci-regain @@ -30,12 +30,12 @@ case "${1-}" in esac case "${2-}" in "") usage;; - *) device="$2" + *) device="${2}" esac test "$(id -u)" = "0" || exec sudo "${0}" -echo "$device" | tee /sys/bus/pci/drivers/pciback/unbind -modalias="$(cat "/sys/bus/pci/devices/$device/modalias")" -mod="$(modprobe -R "$modalias | head -n 1)" -echo "$device" | tee "/sys/bus/pci/drivers/$mod/bind")" +echo "${device}" | tee /sys/bus/pci/drivers/pciback/unbind +modalias="$(cat "/sys/bus/pci/devices/${device}/modalias")" +module="$(modprobe -R "${modalias}" | head -n 1)" +echo "${device}" | tee "/sys/bus/pci/drivers/${module}/bind"