From: Michael Tremer Date: Thu, 17 Jun 2010 22:25:36 +0000 (+0200) Subject: network: Add two functions to make very nice status output. X-Git-Tag: 001~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9178284dba1de48118560492553ae55862d1a8e8;p=network.git network: Add two functions to make very nice status output. --- diff --git a/functions.cli b/functions.cli index 3c8bccef..095a5f7f 100644 --- a/functions.cli +++ b/functions.cli @@ -326,3 +326,17 @@ function cli_usage() { echo "Network configuration tool. Report all bugs to ." } + +function cli_status_headline() { + local zone=${1} + + local state="${COLOUR_DOWN}DOWN${COLOUR_NORMAL}" + zone_is_up ${zone} && state="${COLOUR_UP}UP${COLOUR_NORMAL}" + + echo -e "${zone} - ${state} - $(zone_get_hook ${zone})" +} + +function cli_headline() { + echo + echo -e "${COLOUR_BOLD}$@${COLOUR_NORMAL}" +}