better backup location checks

This commit is contained in:
AustrianToast 2024-07-07 01:17:06 +02:00
parent b7a2dc89be
commit 2fff3ce2a2
Signed by: AustrianToast
GPG Key ID: 378A29F999424B1C

27
update
View File

@ -1,9 +1,6 @@
#!/usr/bin/bash
source "$HOME"/.config/update.conf || exit 1
[[ ! -d $BACKUP_LOCATION ]] && mkdir --parents "$BACKUP_LOCATION"
VERSION="2.1.0"
VERSION="2.1.1"
IGREEN="\033[0;92m" # Intense Green
IYELLOW="\033[0;93m" # Intense Yellow
NO_COLOR="\033[0m" # Text Reset
@ -11,6 +8,28 @@ TMP="/tmp/update"
DATE="$(date +"%Y-%m-%dT%H:%M:%S%:z")" # RFC 3339 date-time https://datatracker.ietf.org/doc/html/rfc3339#section-5.6
FINAL_COMMAND="true"
source "$HOME"/.config/update.conf || exit 1
if [ ! -d $BACKUP_LOCATION ]; then
echo -e "${IYELLOW}Backup location doesn't exist${NO_COLOR}"
read -p "Do you want to create the path and continue? [y/N]" input
case $input in
[Yy]) mkdir --parents "$BACKUP_LOCATION" ;;
[Nn]) exit 0;;
* ) exit 0 ;;
esac
fi
if [ ! -d $SECONDARY_BACKUP_LOCATION ]; then
echo -e "${IYELLOW}Secondary Backup location doesn't exist${NO_COLOR}"
read -p "Do you want to create the path and continue? [y/N]" input
case $input in
[Yy]) mkdir --parents "$SECONDARY_BACKUP_LOCATION" ;;
[Nn]) exit 0;;
* ) exit 0 ;;
esac
fi
trap interrupt_function INT
interrupt_function() {