Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
backupninja
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Liberate
backupninja
Commits
8386e304
Commit
8386e304
authored
19 years ago
by
micah
Browse files
Options
Downloads
Patches
Plain Diff
Converted some bashisms to POSIX -- no concept of arrays in posix, bleh
parent
85a7eb35
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backupninja.in
+8
-10
8 additions, 10 deletions
src/backupninja.in
with
8 additions
and
10 deletions
src/backupninja.in
+
8
−
10
View file @
8386e304
...
...
@@ -19,7 +19,7 @@
#####################################################
## FUNCTIONS
function
setupcolors() {
setupcolors
() {
BLUE="\033[34;01m"
GREEN="\033[32;01m"
YELLOW="\033[33;01m"
...
...
@@ -27,20 +27,18 @@ function setupcolors() {
RED="\033[31;01m"
OFF="\033[0m"
CYAN="\033[36;01m"
COLORS=($BLUE $GREEN $YELLOW $RED $PURPLE)
}
function
colorize() {
colorize
() {
if [ "$usecolors" == "yes" ]; then
local typestr=`echo "$@" | sed 's/\(^[^:]*\).*$/\1/'`
[ "$typestr" == "Debug" ] && type=0
[ "$typestr" == "Info" ] && type=1
[ "$typestr" == "Warning" ] && type=2
[ "$typestr" == "Error" ] && type=3
[ "$typestr" == "Fatal" ] && type=4
color=${COLORS[$type]}
[ "$typestr" == "Debug" ] && COLOR=$BLUE
[ "$typestr" == "Info" ] && COLOR=$GREEN
[ "$typestr" == "Warning" ] && COLOR=$YELLOW
[ "$typestr" == "Error" ] && COLOR=$RED
[ "$typestr" == "Fatal" ] && COLOR=$PURPLE
endcolor=$OFF
echo -e "$
color
$@$endcolor"
echo -e "$
COLOR
$@$endcolor"
else
echo -e "$@"
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment