mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 04:59:25 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
1492bf5e40
commit
e98975a213
1 changed files with 4 additions and 3 deletions
|
@ -92,8 +92,7 @@ func (l *TriggerList) Dispatch(e session.Event) (ident string, cmd string, err e
|
||||||
|
|
||||||
for id, t := range l.triggers {
|
for id, t := range l.triggers {
|
||||||
if e.Tag == t.For {
|
if e.Tag == t.For {
|
||||||
found = true
|
|
||||||
ident = id
|
|
||||||
// this is ugly but it's also the only way to allow
|
// this is ugly but it's also the only way to allow
|
||||||
// the user to do this easily - since each event Data
|
// the user to do this easily - since each event Data
|
||||||
// field is an interface and type casting is not possible
|
// field is an interface and type casting is not possible
|
||||||
|
@ -102,9 +101,11 @@ func (l *TriggerList) Dispatch(e session.Event) (ident string, cmd string, err e
|
||||||
// user to access it in the command via JSON-Query, example:
|
// user to access it in the command via JSON-Query, example:
|
||||||
//
|
//
|
||||||
// events.on wifi.client.new "wifi.deauth {{Client\mac}}"
|
// events.on wifi.client.new "wifi.deauth {{Client\mac}}"
|
||||||
|
cmd = t.Action
|
||||||
|
found = true
|
||||||
|
ident = id
|
||||||
buf := ([]byte)(nil)
|
buf := ([]byte)(nil)
|
||||||
doc := (*jsonquery.Node)(nil)
|
doc := (*jsonquery.Node)(nil)
|
||||||
cmd = t.Action
|
|
||||||
// parse each {EXPR}
|
// parse each {EXPR}
|
||||||
for _, m := range reQueryCapture.FindAllString(t.Action, -1) {
|
for _, m := range reQueryCapture.FindAllString(t.Action, -1) {
|
||||||
// parse the event Data field as a JSON objects once
|
// parse the event Data field as a JSON objects once
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue