Fixes: #11374
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
_network_route() {
local words=( $@ )
+ local commands="static"
+ local cmd="$(_network_find_on_cmdline "${commands}")"
+ if [[ -z "${cmd}" ]]; then
+ COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") )
+ return 0
+ fi
+
+ case "${cmd}" in
+ static)
+ local args="${words[@]}"
+ _network_route_static ${args}
+ ;;
+ esac
+
+}
+
+_network_route_static() {
+ local words=( $@ )
+
local commands="add list remove reload"
local cmd="$(_network_find_on_cmdline "${commands}")"
if [[ -z "${cmd}" ]]; then
local action=${1}
shift
+ case "${action}" in
+ static)
+ cli_route_static $@
+ ;;
+ *)
+ error "Unrecognized action: ${action}"
+ cli_run_help network route
+
+ exit ${EXIT_ERROR}
+ ;;
+ esac
+
+ exit ${EXIT_OK}
+
+
+}
+
+cli_route_static() {
+ if cli_help_requested $@; then
+ cli_show_man network-route-static
+ exit ${EXIT_OK}
+ fi
+
+ local action=${1}
+ shift
+
case "${action}" in
# Add a new route.
add)