]> git.ipfire.org Git - people/arne_f/network.git/commitdiff
network: Add shortcut "network status <zone>".
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Jun 2010 17:37:36 +0000 (19:37 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Jun 2010 17:37:36 +0000 (19:37 +0200)
functions.cli
network

index 095a5f7f599bbdd38e887e7e3735c9539e04ecd1..4defee8f6ddc30956b3aa0a207c7724d762b4ce4 100644 (file)
@@ -234,6 +234,20 @@ function cli_restart() {
        cli_start $@
 }
 
+function cli_status() {
+       if cli_help_requested $@; then
+               cli_usage root-status
+               exit ${EXIT_OK}
+       fi
+
+       local zones=$(zones_get $@)
+
+       local zone
+       for zone in ${zones}; do
+               zone_status ${zone}
+       done
+}
+
 function cli_help_requested() {
        local argument
        for argument in $@; do
@@ -255,11 +269,11 @@ function cli_usage() {
                        echo "  start  - ..."
                        echo "  stop   - ..."
                        echo "  restart - ..."
+                       echo "  status - ..."
                        echo
                        echo "  config - ..."
                        echo
                        echo "  device - ..."
-                       echo "  show   - ???"
                        echo "  zone   - ..."
                        echo
                        ;;
@@ -295,6 +309,26 @@ function cli_usage() {
                        echo    "    be processed."
                        echo
                        ;;
+               root-status)
+                       echo    "${0}: ${what#root-} [--local-only|--remote-only|--all|<zone>...]"
+                       echo
+                       echo    "  This commands shows status information of all zones by default."
+                       echo    "  One can pass several parameters to only process a subset of all"
+                       echo    "  available zones:"
+                       echo
+                       echo -e "    ${BOLD}--local-only${NORMAL}"
+                       echo    "    Process all local zones which includes every zone without red."
+                       echo
+                       echo -e "    ${BOLD}--remote-only${NORMAL}"
+                       echo    "    Process all remote zones which means only the red ones."
+                       echo
+                       echo -e "    ${BOLD}--all${NORMAL}"
+                       echo    "    Process all zones. This is the default parameter."
+                       echo
+                       echo    "    Additionally, you can pass one or more zone names which will"
+                       echo    "    be processed."
+                       echo
+                       ;;
                root-zone)
                        echo    "${0}: ${what#root-} <create|remove> <zone> [<type> <options...>]"
                        echo
diff --git a/network b/network
index 559630c37a46952d5580f71d65d392df73d6f213..6787420b5eb7f98bac065f3d852f0fb472796e6e 100755 (executable)
--- a/network
+++ b/network
@@ -62,8 +62,8 @@ case "${action}" in
                cli_restart $@
                ;;
 
-       show)
-               cli_show $@
+       status)
+               cli_status $@
                ;;
 
        ""|help)