diff --git a/lib/apply_CHANGES.sh b/lib/apply_CHANGES.sh index 009d997..92502a3 100755 --- a/lib/apply_CHANGES.sh +++ b/lib/apply_CHANGES.sh @@ -74,7 +74,8 @@ to build your new initrd image (all of this will require sudo permissions!)" function main () { - SCRIPTDIR=$(dirname "$(realpath $0)" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") + SCRIPTDIR=$(dirname "$(realpath "$0")" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") + apply_CHANGES } diff --git a/lib/get_GPU.sh b/lib/get_GPU.sh index ef2dead..e8a7633 100755 --- a/lib/get_GPU.sh +++ b/lib/get_GPU.sh @@ -15,14 +15,14 @@ does not belong to itself. Both cards must also have unique hardware ids [xxxx:y Press q to quit " - read -p "Which group number do you want to check?: " IOMMU_GROUP + read -r -p "Which group number do you want to check?: " IOMMU_GROUP case "${IOMMU_GROUP}" in [1-9]*) - exec "$SCRIPTDIR/lib/get_GPU_GROUP.sh" $IOMMU_GROUP + exec "$SCRIPTDIR/lib/get_GPU_GROUP.sh" "$IOMMU_GROUP" ;; [Qq]*) - printf "Aborted, your setup is incomplete! + echo "Aborted, your setup is incomplete! DO NOT use any of the files from $SCRIPTDIR/config ! " ;; @@ -33,7 +33,7 @@ DO NOT use any of the files from $SCRIPTDIR/config ! } function main () { - SCRIPTDIR=$(dirname "$(realpath $0)" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") + SCRIPTDIR=$(dirname "$(realpath "$0")" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") get_GPU } diff --git a/lib/get_GPU_GROUP.sh b/lib/get_GPU_GROUP.sh index 86b851a..f0c1309 100755 --- a/lib/get_GPU_GROUP.sh +++ b/lib/get_GPU_GROUP.sh @@ -1,6 +1,6 @@ #!/bin/bash -function get_GROUP () { +function get_GPU_GROUP () { clear # Get the config paths source "$SCRIPTDIR/lib/paths.sh" @@ -58,9 +58,9 @@ USB_CTL_ID=() } function main () { - SCRIPTDIR=$(dirname "$(realpath $0)" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") + SCRIPTDIR=$(dirname "$(realpath "$0")" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") - get_GROUP "$1" + get_GPU_GROUP "$1" } main "$1" diff --git a/lib/get_GPU_ROM.sh b/lib/get_GPU_ROM.sh index 82180e5..568d2af 100755 --- a/lib/get_GPU_ROM.sh +++ b/lib/get_GPU_ROM.sh @@ -61,7 +61,7 @@ echo 0 | sudo tee $VBIOS_PATH function main () { - SCRIPTDIR=$(dirname "$(realpath $0)" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") + SCRIPTDIR=$(dirname "$(realpath "$0")" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") get_GPU_ROM "$1" } diff --git a/lib/get_USB_CTL.sh b/lib/get_USB_CTL.sh index 4fcc00a..ccda58c 100755 --- a/lib/get_USB_CTL.sh +++ b/lib/get_USB_CTL.sh @@ -15,11 +15,11 @@ is only needed if you intend to use other devices than just mouse and keyboard w Press q to quit " - read -p "Which group number do you want to check?: " IOMMU_GROUP + read -r -p "Which group number do you want to check?: " IOMMU_GROUP case "${IOMMU_GROUP}" in [1-9]*) - exec "$SCRIPTDIR/lib/get_USB_CTL_GROUP.sh" $IOMMU_GROUP + exec "$SCRIPTDIR/lib/get_USB_CTL_GROUP.sh" "$IOMMU_GROUP" ;; [Qq]*) exec "$SCRIPTDIR/lib/apply_CHANGES.sh" @@ -31,7 +31,7 @@ Press q to quit } function main () { - SCRIPTDIR=$(dirname "$(realpath $0)" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") + SCRIPTDIR=$(dirname "$(realpath "$0")" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") get_USB_CTL } diff --git a/lib/get_USB_CTL_GROUP.sh b/lib/get_USB_CTL_GROUP.sh index ea9de2f..956e9bb 100755 --- a/lib/get_USB_CTL_GROUP.sh +++ b/lib/get_USB_CTL_GROUP.sh @@ -20,7 +20,7 @@ To use any of the devices shown for passthrough, all of them have to be passed t To return to the previous page just press ENTER. " - read -p "Do you want to use the displayed devices for passthrough? [y/N]: " YESNO + read -r -p "Do you want to use the displayed devices for passthrough? [y/N]: " YESNO case "${YESNO}" in [Yy]*) @@ -39,7 +39,7 @@ To return to the previous page just press ENTER. } function main () { - SCRIPTDIR=$(dirname "$(realpath $0)" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") + SCRIPTDIR=$(dirname "$(realpath "$0")" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") get_USB_CTL_GROUP $1 } diff --git a/lib/set_CMDLINE.sh b/lib/set_CMDLINE.sh index 5a8e763..9a53365 100755 --- a/lib/set_CMDLINE.sh +++ b/lib/set_CMDLINE.sh @@ -170,7 +170,7 @@ function set_CMDLINE () { function main () { - SCRIPTDIR=$(dirname "$(realpath $0)" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") + SCRIPTDIR=$(dirname "$(realpath "$0")" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") set_CMDLINE } diff --git a/lib/set_INITRAMFSTOOLS.sh b/lib/set_INITRAMFSTOOLS.sh index 6a06a80..288875d 100755 --- a/lib/set_INITRAMFSTOOLS.sh +++ b/lib/set_INITRAMFSTOOLS.sh @@ -59,7 +59,7 @@ function set_INITRAMFSTOOLS () { function main () { - SCRIPTDIR=$(dirname "$(realpath $0)" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") + SCRIPTDIR=$(dirname "$(realpath "$0")" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") set_INITRAMFSTOOLS "$1" } diff --git a/lib/set_MODPROBE.sh b/lib/set_MODPROBE.sh index 5f66ebe..c87495c 100755 --- a/lib/set_MODPROBE.sh +++ b/lib/set_MODPROBE.sh @@ -29,7 +29,7 @@ softdep radeon pre: vfio vfio_pci } function main () { - SCRIPTDIR=$(dirname "$(realpath $0)" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") + SCRIPTDIR=$(dirname "$(realpath "$0")" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") set_MODPROBE "$1" } diff --git a/lib/set_VFIO.sh b/lib/set_VFIO.sh index 3a9f4b6..18da794 100755 --- a/lib/set_VFIO.sh +++ b/lib/set_VFIO.sh @@ -13,7 +13,7 @@ function set_VFIO () { echo " Disabling video output in Linux for the card you want to use in a VM will make it easier to successfully do the passthrough without issues." - read -p "Do you want to force disable video output in linux on this card? [Y/n]: " DISABLE_VGA + read -r -p "Do you want to force disable video output in linux on this card? [Y/n]: " DISABLE_VGA case "${DISABLE_VGA}" in [Yy]*) # Update kernel_args file @@ -37,7 +37,7 @@ will make it easier to successfully do the passthrough without issues." } function main () { - SCRIPTDIR=$(dirname "$(realpath $0)" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") + SCRIPTDIR=$(dirname "$(realpath "$0")" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//") set_VFIO "$1" }