diff options
| author | Donald Lee <dlqs@gmx.com> | 2021-07-18 06:25:15 +0800 | 
|---|---|---|
| committer | Donald Lee <dlqs@gmx.com> | 2021-07-18 06:32:03 +0800 | 
| commit | 596b44af8a51c79a7e23447c8c45baf0d6638a63 (patch) | |
| tree | 9fd930949d78b176041742223b9096fdc578aef0 /lib/command.c | |
| parent | 9d6204020daf5d1f97bcc7f21d0c8776aa686672 (diff) | |
lib: Remove warning about script not found
Signed-off-by: Donald Lee <dlqs@gmx.com>
Diffstat (limited to 'lib/command.c')
| -rw-r--r-- | lib/command.c | 9 | 
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/command.c b/lib/command.c index ceea186a9d..4da59c9dd6 100644 --- a/lib/command.c +++ b/lib/command.c @@ -2430,12 +2430,11 @@ DEFUN(script,  	(void)str2prefix("1.2.3.4/24", &p);  	struct frrscript *fs = frrscript_new(argv[1]->arg); -	if (fs == NULL) { -		vty_out(vty, "Script '/etc/frr/scripts/%s.lua' not found\n", -			argv[1]->arg); +	if (frrscript_load(fs, argv[2]->arg, NULL)) { +		vty_out(vty, +			"/etc/frr/scripts%s.lua or function '/%s' not found\n", +			argv[1]->arg, argv[2]->arg);  	} -	if (frrscript_load(fs, argv[2]->arg, NULL)) -		vty_out(vty, "Script function '/%s' not found\n", argv[2]->arg);  	int ret = frrscript_call(fs, argv[2]->arg, ("p", &p));  	char buf[40];  | 
