From ff1a3dc0544c9c6598e7b63f74a77f7628835674 Mon Sep 17 00:00:00 2001 From: rs232 Date: Thu, 25 Jul 2024 08:55:25 +0000 Subject: [PATCH] nvram_ops - added centralised console font & background color definition --- .../src-rt-6.x.4708/router/others/nvram_ops | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/release/src-rt-6.x.4708/router/others/nvram_ops b/release/src-rt-6.x.4708/router/others/nvram_ops index a24def35bf..29a7b918b0 100755 --- a/release/src-rt-6.x.4708/router/others/nvram_ops +++ b/release/src-rt-6.x.4708/router/others/nvram_ops @@ -1,4 +1,5 @@ #!/bin/sh +## <-- NVRAM operations alias NG="nvram get" alias NS="nvram set" alias NU="nvram unset" @@ -7,3 +8,42 @@ alias NC="nvram commit" alias NE='_vrb(){ nvram show 2>/dev/null | grep -Eq "^${1}=" && echo "1" || echo "0"; }; _vrb' # NP (nvram populated): NP returns 1 if the variable is defined and not null, otherwise 0 alias NP='_vrb(){ [ $(nvram get "${1}" 2>/dev/null | wc -c) -gt "0" ] && echo "1" || echo "0";}; _vrb' +## NVRAM --> + +## <-- COLORS +# Usage: echo -e ${b_color}${f_color}Hello World${b_black} +# BACKGROUNDS +b_black="\033[40m" # use this to also fully reset colors +b_red="\033[41m" +b_green="\033[42m" +b_yellow="\033[43m" +b_blue="\033[44m" +b_magenta="\033[45m +b_cyan="\033[46m" +b_white="\033[47m" +b_grey="\033[100m" +b_light_red="\033[101m" +b_light_green="\033[102m" +b_light_yellow="\033[103m" +b_light_blue="\033[104m" +b_light_magenta="\033[105m" +b_light_cyan="\033[106m" +b_light_white="\033[107m" +# FONTS +f_black="\033[30m" +f_red="\033[31m" +f_green="\033[32m" +f_yellow="\033[33m" +f_blue="\033[34m" +f_magenta="\033[35m +f_cyan="\033[36m" +f_white="\033[37m" +f_grey="\033[90m" +f_light_red="\033[91m" +f_light_green="\033[92m!" +f_light_yellow="\033[93m" +f_light_blue="\033[94m" +f_light_magenta="\033[95m" +f_light_cyan="\033[96m" +f_light_white="\033[97m" +## COLORS --> \ No newline at end of file