mirror of
https://github.com/bettercap/bettercap
synced 2025-07-11 15:46:59 -07:00
Cleaner handling of modules start/stop
This commit is contained in:
parent
1ee605d01d
commit
b1678b5902
6 changed files with 66 additions and 42 deletions
|
@ -26,17 +26,19 @@ func NewDiscovery(s *session.Session) *Discovery {
|
|||
quit: make(chan bool),
|
||||
}
|
||||
|
||||
d.AddHandler(session.NewModuleHandler("net.recon (on|off)", "^net\\.recon\\s+(on|off)$",
|
||||
"Start/stop network hosts discovery in background.",
|
||||
d.AddHandler(session.NewModuleHandler("net.recon on", "",
|
||||
"Start network hosts discovery.",
|
||||
func(args []string) error {
|
||||
if args[0] == "on" {
|
||||
return d.Start()
|
||||
} else {
|
||||
return d.Stop()
|
||||
}
|
||||
return d.Start()
|
||||
}))
|
||||
|
||||
d.AddHandler(session.NewModuleHandler("net.show", "^net\\.show$",
|
||||
d.AddHandler(session.NewModuleHandler("net.recon off", "",
|
||||
"Stop network hosts discovery.",
|
||||
func(args []string) error {
|
||||
return d.Stop()
|
||||
}))
|
||||
|
||||
d.AddHandler(session.NewModuleHandler("net.show", "",
|
||||
"Show current hosts list.",
|
||||
func(args []string) error {
|
||||
return d.Show()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue