Use -e instead of -f when checking for existence so this can be used to mount stuff in /dev

This commit is contained in:
Kevin MacMartin 2021-11-15 23:12:01 -05:00
parent d5610d4c32
commit d939c56fef

View file

@ -139,7 +139,7 @@ function mount_image {
mountpoint="$2"
# Exit with an error if either the image file or mount point do not exist
[[ ! -f "$filename" ]] && error_exit "${c_m}$filename${c_w} does not exist"
[[ ! -e "$filename" ]] && error_exit "${c_m}$filename${c_w} does not exist"
[[ -e "$mountpoint" ]] || error_exit "${c_m}$mountpoint${c_w} does not exist"
[[ -d "$mountpoint" ]] || error_exit "${c_m}$mountpoint${c_w} is not a directory"