From 51c70bc03225f2ef4eaa14bc4041819f3aac7dd4 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Fri, 11 Aug 2023 18:21:12 +0300 Subject: [PATCH] vtysh: Print uniq lines when parsing `no service ...` Before this patch: ``` no service cputime-warning no service cputime-warning no ipv6 forwarding no service cputime-warning no service cputime-warning no service cputime-warning ``` Signed-off-by: Donatas Abraitis --- vtysh/vtysh_config.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c index d98f83dbf6..45a639934b 100644 --- a/vtysh/vtysh_config.c +++ b/vtysh/vtysh_config.c @@ -492,12 +492,10 @@ void vtysh_config_parse_line(void *arg, const char *line) strlen("no ip prefix-list")) == 0 || strncmp(line, "no ipv6 prefix-list", strlen("no ipv6 prefix-list")) == 0 || - strncmp(line, "service cputime-stats", - strlen("service cputime-stats")) == 0 || - strncmp(line, "no service cputime-stats", - strlen("no service cputime-stats")) == 0 || - strncmp(line, "service cputime-warning", - strlen("service cputime-warning")) == 0) + strncmp(line, "service ", strlen("service ")) == + 0 || + strncmp(line, "no service ", + strlen("no service ")) == 0) config_add_line_uniq(config_top, line); else config_add_line(config_top, line); -- 2.39.5