Skip to content

Commit

Permalink
Loop disk selection until a valid number is entered.
Browse files Browse the repository at this point in the history
Fixes #33.
  • Loading branch information
wesbarnett committed May 29, 2017
1 parent c040bc0 commit dfab7e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/snap-sync
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ if [[ "$disk" == -1 ]]; then
done
printf "%4s) Exit\n" "0"
read -r -p "Enter a number: " disk
if ! [[ $disk == ?(-)+([0-9]) ]]; then
printf "\nNo disk selected. Select a disk to continue.\n"
disk=-1
fi
done
if [[ $disk == 0 ]]; then
exit 0
Expand Down

0 comments on commit dfab7e8

Please sign in to comment.