validity check for backup

This commit is contained in:
Heavybullets8 2022-08-30 22:06:20 -06:00
parent a406406002
commit 5a1f5a087e

View File

@ -32,6 +32,8 @@ case $selection in
;;
4)
read -rt 120 -p "What is the maximun number of backups you would like?: " number_of_backups || { echo -e "\nFailed to make a selection in time" ; exit; }
! [[ $number_of_backups =~ ^[0-9]+$ ]] && echo -e "Error: -b needs to be assigned an interger\n\"""$number_of_backups""\" is not an interger" >&2 && exit
[[ "$number_of_backups" -le 0 ]] && echo "Error: Number of backups is required to be at least 1" && exit
;;
5)
restore