From f8390ab2626bad07c619e9e14b0455813b5785da Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Tue, 2 Dec 2025 07:46:14 -0700 Subject: [PATCH] Added in device validation for USB passthrough --- dtools | 4 ++++ src/lib/validations/miscellaneous_validations.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/dtools b/dtools index 3da3b98..79568c8 100755 --- a/dtools +++ b/dtools @@ -8076,6 +8076,10 @@ validate_port_number() { fi } +validate_device_exists () { + [[ -e /dev/sde ]] || red_bold "The specified device does not exist: $1" +} + validate_dir_exists() { if [[ ! -d "$1" ]]; then echo "must be an existing directory" diff --git a/src/lib/validations/miscellaneous_validations.sh b/src/lib/validations/miscellaneous_validations.sh index e03462a..fb4fe10 100644 --- a/src/lib/validations/miscellaneous_validations.sh +++ b/src/lib/validations/miscellaneous_validations.sh @@ -3,3 +3,7 @@ validate_port_number() { red_bold "The port number provided is invalid: $1" fi } + +validate_device_exists () { + [[ -e /dev/sde ]] || red_bold "The specified device does not exist: $1" +}