]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
initscripts: Add some color codes to functions library.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 28 Aug 2009 10:41:50 +0000 (12:41 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 28 Aug 2009 10:41:50 +0000 (12:41 +0200)
src/initscripts/core/functions

index 9e7d87e1814765767fa41c431bc25a4ee31d9459..c5451ff70d7842520de9f810249b9f487d6a5905 100644 (file)
@@ -60,13 +60,57 @@ SET_COL="\\033[${COL}G"      # at the $COL char
 SET_WCOL="\\033[${WCOL}G"    # at the $WCOL char
 CURS_UP="\\033[1A\\033[0G"   # Up one line, at the 0'th char
 
+# Normal colors
+CLR_NORM_BLK="\\033[0;30m"    # black
+CLR_NORM_RED="\\033[0;31m"    # red
+CLR_NORM_GRN="\\033[0;32m"    # green
+CLR_NORM_YEL="\\033[0;33m"    # yellow
+CLR_NORM_BLU="\\033[0;34m"    # blue
+CLR_NORM_MAG="\\033[0;35m"    # magenta
+CLR_NORM_CYN="\\033[0;36m"    # cyan
+CLR_NORM_WHT="\\033[0;37m"    # white
+CLR_NORM_GRY="\\033[0;39m"    # grey
+
+# Emphased colors
+CLR_BOLD_BLK="\\033[1;30m"    # black
+CLR_BOLD_RED="\\033[1;31m"    # red
+CLR_BOLD_GRN="\\033[1;32m"    # green
+CLR_BOLD_YEL="\\033[1;33m"    # yellow
+CLR_BOLD_BLU="\\033[1;34m"    # blue
+CLR_BOLD_MAG="\\033[1;35m"    # magenta
+CLR_BOLD_CYN="\\033[1;36m"    # cyan
+CLR_BOLD_WHT="\\033[1;37m"    # white
+CLR_BOLD_GRY="\\033[1;39m"    # grey
+
+# Background colors
+CLR_BACK_BLK="\\033[40m"      # black
+CLR_BACK_RED="\\033[41m"      # red
+CLR_BACK_GRN="\\033[42m"      # green
+CLR_BACK_YEL="\\033[43m"      # yellow
+CLR_BACK_BLU="\\033[44m"      # blue
+CLR_BACK_MAG="\\033[45m"      # magenta
+CLR_BACK_CYN="\\033[46m"      # cyan
+CLR_BACK_WHT="\\033[47m"      # white
+
+# Action colors
+BOLD=$CLR_BOLD_GRY
+DONE=$CLR_BOLD_GRN
+SKIP=$CLR_BOLD_BLU
+WARN=$CLR_BOLD_MAG
+FAIL=$CLR_BOLD_RED
+NORMAL=$CLR_NORM_GRY
+
+# Color hooks
+BRACKET_L="${CLR_BOLD_BLU}[${NORMAL}"
+BRACKET_R="${CLR_BOLD_BLU}]${NORMAL}"
+
 # Define custom colors used in messages printed to the screen
-BRACKET="\\033[1;34m" # Blue
-FAILURE="\\033[1;31m" # Red
-INFO="\\033[1;36m"    # Cyan
-NORMAL="\\033[0;39m"  # Grey
-SUCCESS="\\033[1;32m" # Green
-WARNING="\\033[1;33m" # Yellow
+BRACKET=${CLR_BOLD_BLU} # Blue
+FAILURE=${CLR_BOLD_RED} # Red
+INFO=${CLR_BOLD_CYN}    # Cyan
+NORMAL=${CLR_NORM_GRY}  # Grey
+SUCCESS=${CLR_BOLD_GRN} # Green
+WARNING=${CLR_BOLD_YEL} # Yellow
 
 # Prefix boot messages for easier reading on framebuffer consoles
 PREFIX_SUCCESS=" ${SUCCESS}*${NORMAL} "