From f29aeb2e2316f81a2517ac3abb18322f391f6e59 Mon Sep 17 00:00:00 2001 From: yo Date: Sun, 10 Jul 2022 19:54:23 +0200 Subject: [PATCH] Execute poststop --- cmd/stop.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/stop.go b/cmd/stop.go index ce704e3..2fd1985 100644 --- a/cmd/stop.go +++ b/cmd/stop.go @@ -343,6 +343,17 @@ func StopJail(args []string) { } } + // TODO: Execute poststop + if len(cj.Config.Exec_poststop) > 0 { + fmt.Printf(" > Execute poststop:\n") + _, err := executeCommand(cj.Config.Exec_poststop) + if err != nil { + fmt.Printf("ERROR: %s\n", err.Error()) + } else { + fmt.Printf(" > Execute poststop: OK\n") + } + } + // Remove parameter file pfile := fmt.Sprintf("/var/run/jail.%s.conf", cj.InternalName) if err = os.Remove(pfile); err != nil {