validate user input in launch_bootable_Script

This commit is contained in:
rishwanth1995 2018-08-06 13:48:23 -04:00
parent 78f9cf5fe4
commit da53553675

View File

@ -24,7 +24,7 @@ errorLog () {
exit 1
}
Verify we can find the script
#Verify we can find the script
if [[ -x "$AUTOPSY_BIN" ]]; then
infoLog "Autopsy found"
else
@ -66,7 +66,11 @@ showAndReadOptions () {
echo [$x] "${word}"
x=$((x + 1))
done
read option
read -n 1 option
if [[ $option = "" ]] || ! [[ "$option" =~ ^[0-9]+$ ]]; then
echo "Please choose a valid option"
showAndReadOptions
fi
}