colors for the installer

This commit is contained in:
Marcus 2023-05-01 12:00:55 +02:00
parent 38c6a43e12
commit 5cb831e15b

View file

@ -10,12 +10,41 @@
CHROOTCMD="chroot /mnt/" CHROOTCMD="chroot /mnt/"
message () { ##message () {
echo "== " $1 ## echo "== " $1
##}
# colors for colored output 8)
RED="\e[31m"
GREEN="\e[32m"
YELLOW="\e[33m"
ENDCOLOR="\e[0m"
function message() {
case $1 in
warn)
MESSAGE_TYPE="${YELLOW}WARN${ENDCOLOR}"
;;
error)
MESSAGE_TYPE="${RED}ERROR${ENDCOLOR}"
;;
info|*)
MESSAGE_TYPE="${GREEN}INFO${ENDCOLOR}"
;;
esac
if [ "$1" == "info" ] || [ "$1" == "error" ]
then
MESSAGE=$2
else
MESSAGE=$1
fi
echo -e "[${MESSAGE_TYPE}] $MESSAGE"
} }
error () { error () {
message "ERROR!" message error "ERROR!"
exit 1 exit 1
} }