SHA256
fail instead of looping when no mount target can be read
This commit is contained in:
@@ -360,9 +360,10 @@ case "$action" in
|
|||||||
target=${args[2]}
|
target=${args[2]}
|
||||||
|
|
||||||
if [ -z "$target" ]; then
|
if [ -z "$target" ]; then
|
||||||
|
[ ! -t 0 ] && echo "Error: no target path given and stdin is not a terminal" >&2 && exit 1
|
||||||
while [ -z "$target" ]; do
|
while [ -z "$target" ]; do
|
||||||
echo -n "Target path: "
|
echo -n "Target path: "
|
||||||
read -r target
|
! read -r target && [ -z "$target" ] && echo "Error: no target path given" >&2 && exit 1
|
||||||
[ -d "$target" ] && break
|
[ -d "$target" ] && break
|
||||||
echo -e "\nError: $target: no such directory\n" >&2
|
echo -e "\nError: $target: no such directory\n" >&2
|
||||||
target=''
|
target=''
|
||||||
|
|||||||
Reference in New Issue
Block a user