mirror of
https://github.com/kevinveenbirkenbach/raspberry-pi-tools.git
synced 2024-11-25 11:21:04 +01:00
Added colors
This commit is contained in:
parent
d0636e8306
commit
4715b79aee
26
sd_setup.sh
26
sd_setup.sh
@ -7,16 +7,32 @@ echo "@author Kevin Veen-Birkenbach [kevin@veen.world]"
|
||||
echo "@since 2017-03-12"
|
||||
echo
|
||||
|
||||
# Define colors
|
||||
red_color=`tput setaf 1`
|
||||
green_color=`tput setaf 2`
|
||||
yellow_color=`tput setaf 3`
|
||||
blue_color=`tput setaf 4`
|
||||
magenta_color=`tput setaf 5`
|
||||
reset_color=`tput sgr0`
|
||||
|
||||
message(){
|
||||
echo "$1[$2]:${reset_color} $3 ";
|
||||
}
|
||||
|
||||
question(){
|
||||
echo "[QUESTION]: $1";
|
||||
message "${magenta_color}" "QUESTION" "$1";
|
||||
}
|
||||
|
||||
info(){
|
||||
echo "[INFO]: $1";
|
||||
message "${blue_color}" "INFO" "$1";
|
||||
}
|
||||
|
||||
warning(){
|
||||
echo "[WARNING]: $1";
|
||||
message "${yellow_color}" "WARNING" "$1";
|
||||
}
|
||||
|
||||
success(){
|
||||
message "${green_color}" "SUCCESS" "$1";
|
||||
}
|
||||
|
||||
destructor(){
|
||||
@ -26,7 +42,7 @@ destructor(){
|
||||
}
|
||||
|
||||
error(){
|
||||
echo "[ERROR]: $1 -> Leaving program."
|
||||
message "${red_color}" "ERROR" "$1 -> Leaving program."
|
||||
destructor
|
||||
exit 1;
|
||||
}
|
||||
@ -310,4 +326,4 @@ info "The first level folder structure on $root_mount_path is now:" && tree -laL
|
||||
info "The first level folder structure on $boot_mount_path is now:" && tree -laL 1 "$boot_mount_path"
|
||||
|
||||
destructor
|
||||
info "Setup successfull :)" && exit 0
|
||||
success "Setup successfull :)" && exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user