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" +}