Skip to content

Commit cdb2509

Browse files
author
RootSploit
committed
Track cmd/reconator CLI entrypoint
1 parent b55f706 commit cdb2509

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Binaries
2-
reconator
3-
reconator-*
2+
/reconator
3+
/reconator-*
44
*.exe
55
dist/
66

cmd/reconator/main.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os"
6+
"os/signal"
7+
"syscall"
8+
9+
"github.com/rootsploit/reconator/internal/cli"
10+
"github.com/rootsploit/reconator/internal/exec"
11+
)
12+
13+
func main() {
14+
// Set up signal handler to clean up child processes on exit
15+
sigChan := make(chan os.Signal, 1)
16+
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
17+
18+
go func() {
19+
<-sigChan
20+
fmt.Fprintf(os.Stderr, "\n[!] Received interrupt signal, cleaning up...\n")
21+
exec.KillAllProcesses()
22+
os.Exit(130) // Standard exit code for SIGINT
23+
}()
24+
25+
if err := cli.Execute(); err != nil {
26+
exec.KillAllProcesses()
27+
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
28+
os.Exit(1)
29+
}
30+
}

cmd/reconator/reconator

20.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)