]> git.ipfire.org Git - people/arne_f/network.git/commitdiff
network: Add two functions to make very nice status output.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Jun 2010 22:25:36 +0000 (00:25 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Jun 2010 22:25:36 +0000 (00:25 +0200)
functions.cli

index 3c8bccef816c6f9f94dd22e1c06149599973aa37..095a5f7f599bbdd38e887e7e3735c9539e04ecd1 100644 (file)
@@ -326,3 +326,17 @@ function cli_usage() {
 
        echo "Network configuration tool. Report all bugs to <http://bugs.ipfire.org>."
 }
+
+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}"
+}