]> git.ipfire.org Git - people/arne_f/network.git/commitdiff
network: Add help for restart command.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 4 Jun 2010 01:17:00 +0000 (03:17 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 4 Jun 2010 01:17:00 +0000 (03:17 +0200)
functions.cli
network

index 212415120d74ae6097defd3331ee76fdad1bdc92..14df652a9f376591dacc4031429a66c35da44c47 100644 (file)
@@ -204,6 +204,20 @@ function cli_stop() {
        done
 }
 
+function cli_restart() {
+       if cli_help_requested $@; then
+               cli_usage root-restart
+               exit ${EXIT_OK}
+       fi
+
+       cli_stop $@
+
+       # Give the system some time to calm down
+       sleep 2
+
+       cli_start $@
+}
+
 function cli_help_requested() {
        local argument
        for argument in $@; do
@@ -224,6 +238,7 @@ function cli_usage() {
                        echo
                        echo "  start  - ..."
                        echo "  stop   - ..."
+                       echo "  restart - ..."
                        echo
                        echo "  config - ..."
                        echo
@@ -244,7 +259,7 @@ function cli_usage() {
                        echo    "    ${0} ${what#root-} DEBUG=1 ..."
                        echo
                        ;;
-               root-start|root-stop)
+               root-start|root-stop|root-restart)
                        echo    "${0}: ${what#root-} [--local-only|--remote-only|--all|<zone>...]"
                        echo
                        echo    "  This commands ${what#root-}s all zones by default."
diff --git a/network b/network
index e586da7b4e9394b5edb466cdfe9ea93ff767177f..559630c37a46952d5580f71d65d392df73d6f213 100755 (executable)
--- a/network
+++ b/network
@@ -59,8 +59,7 @@ case "${action}" in
                ;;
 
        restart)
-               cli_stop $@
-               cli_start $@
+               cli_restart $@
                ;;
 
        show)