execute './.ww4/runExit` on exeit of container exec
This commit is contained in:
@@ -85,6 +85,16 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
wwlog.Printf(wwlog.ERROR, "%s\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
_, err = os.Stat("./.ww4/runExit")
|
||||
if os.IsNotExist(err) {
|
||||
wwlog.Printf(wwlog.DEBUG, "no exit script")
|
||||
return nil
|
||||
}
|
||||
err = syscall.Exec("./.ww4/runExit", []string{""}, os.Environ())
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "%s\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user