]> git.tuebingen.mpg.de Git - micoforia.git/commitdiff
Improve the default command for entering a container. master
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 5 May 2021 16:51:35 +0000 (18:51 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Nov 2023 11:43:00 +0000 (12:43 +0100)
This is much quicker and avoids the motd.

micoforia.c

index b09f352b8c5c9b800809c79b4452627478fe5bb4..699354202debf3ab1ac640cdd3cb3e6bfd90fb19 100644 (file)
@@ -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;