This commit is contained in:
Christian Goll
2022-02-03 09:53:16 +01:00
parent ad87ba7647
commit df127b179d

View File

@@ -85,12 +85,13 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
wwlog.Printf(wwlog.ERROR, "%s\n", err)
os.Exit(1)
}
_, err = os.Stat("./.ww4/runExit")
_, err = os.Stat("./etc/warewulf/runExit")
if os.IsNotExist(err) {
wwlog.Printf(wwlog.DEBUG, "no exit script")
return nil
}
err = syscall.Exec("./.ww4/runExit", []string{""}, os.Environ())
wwlog.Printf(wwlog.INFO, "Running exit script %s\n", path.Join(container.RootFsDir(containerName), "./etc/warewulf/runExit"))
err = syscall.Exec("./etc/warewulf/runExit", []string{""}, os.Environ())
if err != nil {
wwlog.Printf(wwlog.ERROR, "%s\n", err)
os.Exit(1)