mirror of https://github.com/martanne/abduco
Use the shell to execute default command given by $ABDUCO_CMD
This allows to specify a default command with arguments as in: $ ABDUCO_CMD="dvtm -m ^b" abduco -c demo
This commit is contained in:
parent
598fdc396f
commit
fdd0c4163f
8
abduco.c
8
abduco.c
|
|
@ -617,9 +617,11 @@ int main(int argc, char *argv[]) {
|
|||
cmd = &argv[optind + 1];
|
||||
|
||||
if (!cmd) {
|
||||
cmd = (char*[]){ getenv("ABDUCO_CMD"), NULL };
|
||||
if (!cmd[0])
|
||||
cmd[0] = "dvtm";
|
||||
char *default_cmd = getenv("ABDUCO_CMD");
|
||||
if (default_cmd)
|
||||
cmd = (char*[]){ "/bin/sh", "-c", default_cmd, NULL };
|
||||
else
|
||||
cmd = (char*[]){ "dvtm", NULL };
|
||||
}
|
||||
|
||||
if (!action && !server.session_name)
|
||||
|
|
|
|||
Loading…
Reference in New Issue