ucm: add exec sequence command

This change renames the original exec command to shell which
is more appropriate. Implement a light version of the exec
command which calls directly the specified executable without
the shell interaction (man 3 system).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-05-11 14:48:16 +02:00
parent a468505c96
commit 590df3a5b1
6 changed files with 312 additions and 7 deletions

View file

@ -910,6 +910,7 @@ cset:
if (strcmp(cmd, "exec") == 0) {
curr->type = SEQUENCE_ELEMENT_TYPE_EXEC;
exec:
err = parse_string_substitute3(uc_mgr, n, &curr->data.exec);
if (err < 0) {
uc_error("error: exec requires a string!");
@ -918,6 +919,11 @@ cset:
continue;
}
if (strcmp(cmd, "shell") == 0) {
curr->type = SEQUENCE_ELEMENT_TYPE_SHELL;
goto exec;
}
if (strcmp(cmd, "comment") == 0)
goto skip;