add new color for errors

This commit is contained in:
AustrianToast 2024-07-13 00:23:49 +02:00
parent 3198a02081
commit 6f9ee34a94
Signed by: AustrianToast
GPG Key ID: 378A29F999424B1C

6
update
View File

@ -3,14 +3,14 @@
VERSION="3.0.0"
IGREEN="\033[0;92m" # Intense Green
IYELLOW="\033[0;93m" # Intense Yellow
IRED='\033[0;91m' # Red
NO_COLOR="\033[0m" # Text Reset
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
source "$HOME"/.config/update.conf || exit 1
source "$HOME"/.config/update.conf || echo -e "${IRED}No config found${NO_COLOR}" || exit 1
check_for_valid_backup_location() {
[[ $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
@ -22,7 +22,7 @@ check_for_valid_backup_location() {
fi
}
check_for_valid_backup_location "$BACKUP_LOCATION"
[[ $BACKUP_LOCATION ]] && check_for_valid_backup_location "$BACKUP_LOCATION" || echo -e "${IRED}No BACKUP_LOCATION specified${NO_COLOR}" || exit 1
[[ $SECONDARY_BACKUP_LOCATION ]] && check_for_valid_backup_location "$SECONDARY_BACKUP_LOCATION"
trap interrupt_function INT