node option also for shell and respect env $SHELL

This commit is contained in:
Christian Goll
2023-01-31 17:52:42 +01:00
parent 317cd5d4e0
commit 05237935eb
3 changed files with 18 additions and 2 deletions

View File

@@ -26,9 +26,14 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
allargs = append(allargs, "--bind", b)
}
*/
args = append(args, "/usr/bin/bash")
shellName := os.Getenv("SHELL")
if shellName == "" {
shellName = "/usr/bin/bash"
}
args = append(args, shellName)
allargs = append(allargs, args...)
wwlog.Debug("Calling exec with args: %s", allargs)
cntexec.SetBinds(binds)
cntexec.SetNode(nodeName)
return cntexec.CobraRunE(cmd, allargs)
}