projects
/
matthijs
/
upstream
/
backupninja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
31ac783
)
Reverted bashism removals from r228, after discussing this.
author
intrigeri
<intrigeri@boum.org>
Tue, 29 Nov 2005 10:32:02 +0000
(10:32 +0000)
committer
intrigeri
<intrigeri@boum.org>
Tue, 29 Nov 2005 10:32:02 +0000
(10:32 +0000)
src/backupninja.in
patch
|
blob
|
history
diff --git
a/src/backupninja.in
b/src/backupninja.in
index 7855a6d894791b3dc139a80a9892790d9dd38bfb..68c7c430c06a1587f25af3f9f2218c9b30a1ac7f 100755
(executable)
--- a/
src/backupninja.in
+++ b/
src/backupninja.in
@@
-19,7
+19,7
@@
#####################################################
## FUNCTIONS
#####################################################
## FUNCTIONS
-setupcolors () {
+
function
setupcolors () {
BLUE="\033[34;01m"
GREEN="\033[32;01m"
YELLOW="\033[33;01m"
BLUE="\033[34;01m"
GREEN="\033[32;01m"
YELLOW="\033[33;01m"
@@
-27,18
+27,20
@@
setupcolors () {
RED="\033[31;01m"
OFF="\033[0m"
CYAN="\033[36;01m"
RED="\033[31;01m"
OFF="\033[0m"
CYAN="\033[36;01m"
+ COLORS=($BLUE $GREEN $YELLOW $RED $PURPLE)
}
}
-colorize () {
+
function
colorize () {
if [ "$usecolors" == "yes" ]; then
local typestr=`echo "$@" | sed 's/\(^[^:]*\).*$/\1/'`
if [ "$usecolors" == "yes" ]; then
local typestr=`echo "$@" | sed 's/\(^[^:]*\).*$/\1/'`
- [ "$typestr" == "Debug" ] && COLOR=$BLUE
- [ "$typestr" == "Info" ] && COLOR=$GREEN
- [ "$typestr" == "Warning" ] && COLOR=$YELLOW
- [ "$typestr" == "Error" ] && COLOR=$RED
- [ "$typestr" == "Fatal" ] && COLOR=$PURPLE
+ [ "$typestr" == "Debug" ] && type=0
+ [ "$typestr" == "Info" ] && type=1
+ [ "$typestr" == "Warning" ] && type=2
+ [ "$typestr" == "Error" ] && type=3
+ [ "$typestr" == "Fatal" ] && type=4
+ color=${COLORS[$type]}
endcolor=$OFF
endcolor=$OFF
- echo -e "$
COLOR
$@$endcolor"
+ echo -e "$
color
$@$endcolor"
else
echo -e "$@"
fi
else
echo -e "$@"
fi