add new color for errors
This commit is contained in:
parent
3198a02081
commit
6f9ee34a94
6
update
6
update
@ -3,14 +3,14 @@
|
|||||||
VERSION="3.0.0"
|
VERSION="3.0.0"
|
||||||
IGREEN="\033[0;92m" # Intense Green
|
IGREEN="\033[0;92m" # Intense Green
|
||||||
IYELLOW="\033[0;93m" # Intense Yellow
|
IYELLOW="\033[0;93m" # Intense Yellow
|
||||||
|
IRED='\033[0;91m' # Red
|
||||||
NO_COLOR="\033[0m" # Text Reset
|
NO_COLOR="\033[0m" # Text Reset
|
||||||
TMP="/tmp/update"
|
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
|
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() {
|
check_for_valid_backup_location() {
|
||||||
[[ $BACKUP_LOCATION ]] || echo -e "${IYELLOW}BACKUP_LOCATION has not been specified${NO_COLOR}"
|
|
||||||
if [ ! -d $1 ]; then
|
if [ ! -d $1 ]; then
|
||||||
echo -e "${IYELLOW}$1 doesn't exist${NO_COLOR}"
|
echo -e "${IYELLOW}$1 doesn't exist${NO_COLOR}"
|
||||||
read -p "Do you want to create the path and continue? [y/N]" input
|
read -p "Do you want to create the path and continue? [y/N]" input
|
||||||
@ -22,7 +22,7 @@ check_for_valid_backup_location() {
|
|||||||
fi
|
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"
|
[[ $SECONDARY_BACKUP_LOCATION ]] && check_for_valid_backup_location "$SECONDARY_BACKUP_LOCATION"
|
||||||
|
|
||||||
trap interrupt_function INT
|
trap interrupt_function INT
|
||||||
|
Loading…
Reference in New Issue
Block a user