]> git.ipfire.org Git - people/ms/network.git/commitdiff
route: add new cli command reload
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Sun, 4 Jun 2017 14:09:07 +0000 (16:09 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 7 Jun 2017 16:32:17 +0000 (18:32 +0200)
This new command just call route_apply.
It provide a nice way to take changes of the config file into affect.
Also it helps when the routes are not applied.
This should not happen, but when this command is better then network restart.

Fixes: 11367
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/bash-completion/network
src/network

index 6f63f1b3955fa02c5d90b88d6ad739601f783df1..27272e9b09c1eabef8a6102a37f36e251f38db22 100644 (file)
@@ -258,7 +258,7 @@ _network_port_subcommand() {
 _network_route() {
        local words=( $@ )
 
-       local commands="add list remove"
+       local commands="add list remove reload"
        local cmd="$(_network_find_on_cmdline "${commands}")"
        if [[ -z "${cmd}" ]]; then
                COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") )
index e65eb6bf92a9527f5d815afb2430f188cdfdac0b..fbb7e9ab67a2ebb7a73efa64602afd5608247886 100644 (file)
@@ -765,6 +765,10 @@ cli_route() {
                        route_list $@
                        return ${EXIT_OK}
                        ;;
+               # Reload all routes.
+               reload)
+                       route_apply $@
+                       ;;
                *)
                        error "Unrecognized action: ${action}"
                        cli_run_help network route