]>
Commit | Line | Data |
---|---|---|
1848564d MT |
1 | #!/bin/bash |
2 | ############################################################################### | |
3 | # # | |
4 | # IPFire.org - A linux based firewall # | |
5 | # Copyright (C) 2010 Michael Tremer & Christian Schmidt # | |
6 | # # | |
7 | # This program is free software: you can redistribute it and/or modify # | |
8 | # it under the terms of the GNU General Public License as published by # | |
9 | # the Free Software Foundation, either version 3 of the License, or # | |
10 | # (at your option) any later version. # | |
11 | # # | |
12 | # This program is distributed in the hope that it will be useful, # | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
15 | # GNU General Public License for more details. # | |
16 | # # | |
17 | # You should have received a copy of the GNU General Public License # | |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # | |
19 | # # | |
20 | ############################################################################### | |
21 | ||
6dbd51ba MT |
22 | COLOUR_GREEN="\\033[1;32m" |
23 | COLOUR_RED="\\033[1;31m" | |
24 | COLOUR_NORMAL="\\033[0;39m" | |
25 | COLOUR_YELLOW="\\033[1;35m" | |
26 | ||
6dbd51ba MT |
27 | COLOUR_BOLD="\\033[1;39m" |
28 | COLOUR_DOWN=${COLOUR_RED} | |
29 | COLOUR_ERROR=${COLOUR_RED} | |
30 | COLOUR_OK=${COLOUR_GREEN} | |
31 | COLOUR_UP=${COLOUR_GREEN} | |
2ab7f50f | 32 | COLOUR_WARN=${COLOUR_YELLOW} |
6dbd51ba | 33 | |
a5ebb169 MT |
34 | COLOUR_ENABLED=${COLOUR_GREEN} |
35 | COLOUR_DISABLED=${COLOUR_RED} | |
36 | ||
6dbd51ba MT |
37 | COLOUR_STP_FORWARDING=${COLOUR_GREEN} |
38 | COLOUR_STP_DISCARDING=${COLOUR_RED} | |
39 | COLOUR_STP_LEARNING=${COLOUR_YELLOW} | |
40 | COLOUR_STP_BLOCKING=${COLOUR_YELLOW} | |
41 | ||
42 | function colours_disable() { | |
43 | local line | |
44 | for line in $(set | grep "^COLOUR_"); do | |
45 | unset ${line%%=*} | |
46 | done | |
47 | } | |
48 | ||
49 | function colours_auto_disable() { | |
50 | if [ "${TERM}" = "dumb" ]; then | |
51 | colours_disable | |
52 | fi | |
53 | } |