Skip to content

Commit

Permalink
agnhost: fix sigterm shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
aojea committed May 25, 2022
1 parent d5579bf commit 2b82216
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/images/agnhost/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.38
2.39
12 changes: 6 additions & 6 deletions test/images/agnhost/netexec/netexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@ func main(cmd *cobra.Command, args []string) {
close(sigTermReceived)
}()

if delayShutdown > 0 {
go func() {
<-sigTermReceived
go func() {
<-sigTermReceived
if delayShutdown > 0 {
log.Printf("Sleeping %d seconds before terminating...", delayShutdown)
time.Sleep(time.Duration(delayShutdown) * time.Second)
os.Exit(0)
}()
}
}
os.Exit(0)
}()

if httpOverride != "" {
mux := http.NewServeMux()
Expand Down

0 comments on commit 2b82216

Please sign in to comment.