-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoralog.sh
executable file
·42 lines (40 loc) · 977 Bytes
/
oralog.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
HELP()
{
echo usage: ./oralog.sh install
echo " logred red"
echo " loggreen green"
echo " logyellow yellow"
echo " logblue blue"
echo " logwhite white"
}
basename=`basename $0`
if [ "$basename"x = "logred"x ];then
echo -e "\033[1;31m"$*"\033[0m"
elif [ "$basename"x = "loggreen"x ];then
echo -e "\033[1;32m"$*"\033[0m"
elif [ "$basename"x = "logyellow"x ];then
echo -e "\033[1;33m"$*"\033[0m"
elif [ "$basename"x = "logblue"x ];then
echo -e "\033[1;34m"$*"\033[0m"
elif [ "$basename"x = "logwhite"x ];then
echo -e $*
elif [ "$basename"x = "oralog.sh"x ];then
if [ "$1"x = "--help"x ];then
HELP
elif [ "$1"x = "install"x ];then
bindir=/usr/local/bin
install -D $0 $bindir/oralog.sh
cd $bindir/
ln -sf oralog.sh logred
ln -sf oralog.sh loggreen
ln -sf oralog.sh logyellow
ln -sf oralog.sh logblue
ln -sf oralog.sh logwhite
echo oralog.sh installed to $bindir
else
HELP
fi
else
echo please install oralog.sh first!!
fi