mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 04:52:10 -07:00
new: caplets can now include other caplets
This commit is contained in:
parent
892659ba7f
commit
1ab8711d79
3 changed files with 13 additions and 3 deletions
3
caplets/ap-config.cap
Normal file
3
caplets/ap-config.cap
Normal file
|
@ -0,0 +1,3 @@
|
|||
set api.rest.username changeme
|
||||
set api.rest.password changeme
|
||||
set api.rest.address 0.0.0.0
|
|
@ -1,6 +1,4 @@
|
|||
set api.rest.username changeme
|
||||
set api.rest.password changeme
|
||||
set api.rest.address 0.0.0.0
|
||||
include caplets/ap-config.cap
|
||||
|
||||
set net.sniff.local true
|
||||
set net.sniff.verbose false
|
||||
|
|
|
@ -158,6 +158,10 @@ func (s *Session) clsHandler(args []string, sess *Session) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *Session) includeHandler(args []string, sess *Session) error {
|
||||
return s.RunCaplet(args[0])
|
||||
}
|
||||
|
||||
func (s *Session) registerCoreHandlers() {
|
||||
s.CoreHandlers = append(s.CoreHandlers, NewCommandHandler("help",
|
||||
"^(help|\\?)$",
|
||||
|
@ -198,4 +202,9 @@ func (s *Session) registerCoreHandlers() {
|
|||
"^(clear|cls)$",
|
||||
"Clear the screen.",
|
||||
s.clsHandler))
|
||||
|
||||
s.CoreHandlers = append(s.CoreHandlers, NewCommandHandler("include CAPLET",
|
||||
"^include\\s+(.+)",
|
||||
"Load and run this caplet in the current session.",
|
||||
s.includeHandler))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue