From 3e8bd0999084d99f1be0dd90ad5ca1f72c387a7a Mon Sep 17 00:00:00 2001 From: Brian Phan Date: Tue, 29 Nov 2022 09:15:09 -0800 Subject: [PATCH] Env var to identify when in container shell --- internal/app/wwctl/container/shell/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/app/wwctl/container/shell/main.go b/internal/app/wwctl/container/shell/main.go index aa00014f..193e5ab9 100644 --- a/internal/app/wwctl/container/shell/main.go +++ b/internal/app/wwctl/container/shell/main.go @@ -40,6 +40,8 @@ func CobraRunE(cmd *cobra.Command, args []string) error { c.Stdout = os.Stdout c.Stderr = os.Stderr + os.Setenv("WW_CONTAINER_SHELL", "true") + if err := c.Run(); err != nil { fmt.Println(err) os.Exit(1)