shift
local words=( $@ )
- local commands="authentication down inactivity-timeout local mode peer remote security-policy show up"
+ local commands="authentication color down inactivity-timeout local mode peer remote security-policy show up"
local cmd="$(_network_find_on_cmdline "${commands}")"
if [[ -z "${cmd}" ]]; then
COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") )
authentication)
_network_vpn_ipsec_connection_subcommands_authentication ${connection} ${args}
;;
+ color)
+ _network_color ${args}
+ ;;
local)
_network_vpn_ipsec_connection_subcommands_local_remote ${connection} "local" ${args}
;;
authentication|down|disable|dpd|enable|inactivity_timeout|local|mode|peer|pool|remote|security_policy|start_action|up)
ipsec_connection_${key} ${connection} "$@"
;;
+ color)
+ color_cli "ipsec-connection" "${connection}" "$@"
+ ;;
show)
cli_ipsec_connection_show "${connection}"
exit $?
ipsec_strongswan_autostart
}
+ipsec_connection_get_color() {
+ # This function return the color of a zone
+ assert [ $# -eq 1 ]
+
+ local name=${1}
+ color_read "ipsec-connection" ${name}
+}
+
cli_ipsec_connection_show() {
local connection="${1}"
cli_headline 0 "IPsec VPN Connection: ${connection}"
cli_space
+ cli_print_fmt1 1 "Color" "$(cli_color_bar $(ipsec_connection_get_color ${connection}))"
+ cli_space
+
# Peer
if isset PEER; then
cli_print_fmt1 1 "Peer" "${PEER}"