#!/bin/bash ############################################################################### # # # IPFire.org - A linux based firewall # # Copyright (C) 2010 Michael Tremer & Christian Schmidt # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation, either version 3 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program. If not, see . # # # ############################################################################### COLOUR_GREEN="\\033[1;32m" COLOUR_RED="\\033[1;31m" COLOUR_NORMAL="\\033[0;39m" COLOUR_YELLOW="\\033[1;35m" COLOUR_BOLD="\\033[1;39m" COLOUR_DOWN=${COLOUR_RED} COLOUR_ERROR=${COLOUR_RED} COLOUR_OK=${COLOUR_GREEN} COLOUR_UP=${COLOUR_GREEN} COLOUR_WARN=${COLOUR_YELLOW} COLOUR_ENABLED=${COLOUR_GREEN} COLOUR_DISABLED=${COLOUR_RED} COLOUR_STP_FORWARDING=${COLOUR_GREEN} COLOUR_STP_DISCARDING=${COLOUR_RED} COLOUR_STP_LEARNING=${COLOUR_YELLOW} COLOUR_STP_BLOCKING=${COLOUR_YELLOW} function colours_disable() { local line for line in $(set | grep "^COLOUR_"); do unset ${line%%=*} done } function colours_auto_disable() { if [ "${TERM}" = "dumb" ]; then colours_disable fi }