]> git.ipfire.org Git - people/arne_f/network.git/blame - functions.colors
network: Add shortcut "network status <zone>".
[people/arne_f/network.git] / functions.colors
CommitLineData
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
22COLOUR_GREEN="\\033[1;32m"
23COLOUR_RED="\\033[1;31m"
24COLOUR_NORMAL="\\033[0;39m"
25COLOUR_YELLOW="\\033[1;35m"
26
1848564d
MT
27# Define color for messages
28BOLD="\\033[1;39m"
29DONE="\\033[1;32m"
30SKIP="\\033[1;34m"
31WARN="\\033[1;35m"
32FAIL="\\033[1;31m"
33NORMAL="\\033[0;39m"
6dbd51ba
MT
34
35COLOUR_BOLD="\\033[1;39m"
36COLOUR_DOWN=${COLOUR_RED}
37COLOUR_ERROR=${COLOUR_RED}
38COLOUR_OK=${COLOUR_GREEN}
39COLOUR_UP=${COLOUR_GREEN}
40
41COLOUR_STP_FORWARDING=${COLOUR_GREEN}
42COLOUR_STP_DISCARDING=${COLOUR_RED}
43COLOUR_STP_LEARNING=${COLOUR_YELLOW}
44COLOUR_STP_BLOCKING=${COLOUR_YELLOW}
45
46function colours_disable() {
47 local line
48 for line in $(set | grep "^COLOUR_"); do
49 unset ${line%%=*}
50 done
51}
52
53function colours_auto_disable() {
54 if [ "${TERM}" = "dumb" ]; then
55 colours_disable
56 fi
57}