From: Andre Noll Date: Wed, 5 May 2021 16:51:35 +0000 (+0200) Subject: Improve the default command for entering a container. X-Git-Url: http://git.tuebingen.mpg.de/?p=micoforia.git;a=commitdiff_plain;h=600396a0194eb127b2813e47844801e68e4d2a81 Improve the default command for entering a container. This is much quicker and avoids the motd. --- diff --git a/micoforia.c b/micoforia.c index b09f352..6993542 100644 --- a/micoforia.c +++ b/micoforia.c @@ -1922,7 +1922,9 @@ static bool com_enter(void) char **argv; char *nsenter_args[] = {"nsenter", "-w", "-a", "-r", "-t"}; const unsigned nna = ARRAY_SIZE(nsenter_args); /* num nsenter args */ - char *dflt_cmd[] = {"login", "-f", "root"}; + char *dflt_cmd[] = {"bash", "-c", "[[ -f /etc/os-release ]] && " + ". /etc/os-release && printf '%s\n' \"$PRETTY_NAME\"; " + "command cd; exec bash"}; unsigned n, N, ni = lls_num_inputs(sublpr); unsigned nea = ni > 1? ni - 1 : ARRAY_SIZE(dflt_cmd); /* num extra args */ const char *arg;