-cli_route() {
- if cli_help_requested $@; then
- cli_show_man network-route
- exit ${EXIT_OK}
- fi
-
- 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)
- route_add $@
- ;;
- # Remove an existing route.
- remove)
- route_remove $@
- ;;
- # List all routes.
- list)
- route_list $@
- return ${EXIT_OK}
- ;;
- # Reload all routes.
- reload)
- route_apply $@
- ;;
- *)
- error "Unrecognized action: ${action}"
- cli_run_help network route
-
- exit ${EXIT_ERROR}
- ;;
- esac
-
- # Applying all routes.
- route_apply
-
- exit ${EXIT_OK}
-}
-