modify check
This commit is contained in:
parent
6593f087c4
commit
3198a02081
5
update
5
update
@ -10,7 +10,7 @@ DATE="$(date +"%Y-%m-%dT%H:%M:%S%:z")" # RFC 3339 date-time https://datatracker
|
||||
source "$HOME"/.config/update.conf || exit 1
|
||||
|
||||
check_for_valid_backup_location() {
|
||||
if [ $1 ]; then
|
||||
[[ $BACKUP_LOCATION ]] || echo -e "${IYELLOW}BACKUP_LOCATION has not been specified${NO_COLOR}"
|
||||
if [ ! -d $1 ]; then
|
||||
echo -e "${IYELLOW}$1 doesn't exist${NO_COLOR}"
|
||||
read -p "Do you want to create the path and continue? [y/N]" input
|
||||
@ -20,11 +20,10 @@ check_for_valid_backup_location() {
|
||||
* ) exit 0 ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
check_for_valid_backup_location "$BACKUP_LOCATION"
|
||||
check_for_valid_backup_location "$SECONDARY_BACKUP_LOCATION"
|
||||
[[ $SECONDARY_BACKUP_LOCATION ]] && check_for_valid_backup_location "$SECONDARY_BACKUP_LOCATION"
|
||||
|
||||
trap interrupt_function INT
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user