1
0
mirror of https://github.com/bettercap/bettercap.git synced 2025-03-12 04:36:03 -07:00

misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2018-03-28 19:49:46 +02:00
parent a14db649d3
commit 39ed078204
No known key found for this signature in database
GPG Key ID: 1564D7F30393A456
3 changed files with 9 additions and 18 deletions

@ -3,15 +3,9 @@
package modules
import (
"errors"
"github.com/bettercap/bettercap/session"
)
var (
notSupported = errors.New("ble.recon is not supported on this OS")
)
type BLERecon struct {
session.SessionModule
}
@ -35,13 +29,13 @@ func NewBLERecon(s *session.Session) *BLERecon {
d.AddHandler(session.NewModuleHandler("ble.recon on", "",
"Start Bluetooth Low Energy devices discovery.",
func(args []string) error {
return notSupported
return session.ErrNotSupported
}))
d.AddHandler(session.NewModuleHandler("ble.recon off", "",
"Stop Bluetooth Low Energy devices discovery.",
func(args []string) error {
return notSupported
return session.ErrNotSupported
}))
return d
@ -60,13 +54,13 @@ func (d BLERecon) Author() string {
}
func (d *BLERecon) Configure() (err error) {
return notSupported
return session.ErrNotSupported
}
func (d *BLERecon) Start() error {
return notSupported
return session.ErrNotSupported
}
func (d *BLERecon) Stop() error {
return notSupported
return session.ErrNotSupported
}

@ -8,10 +8,6 @@ import (
"github.com/bettercap/bettercap/session"
)
var (
notSupported = errors.New("packet.proxy is not supported on this OS")
)
type PacketProxy struct {
session.SessionModule
}
@ -35,13 +31,13 @@ func (pp PacketProxy) Author() string {
}
func (pp *PacketProxy) Configure() (err error) {
return notSupported
return session.ErrNotSupported
}
func (pp *PacketProxy) Start() error {
return notSupported
return session.ErrNotSupported
}
func (pp *PacketProxy) Stop() error {
return notSupported
return session.ErrNotSupported
}

@ -34,6 +34,7 @@ var (
ErrAlreadyStarted = errors.New("Module is already running.")
ErrAlreadyStopped = errors.New("Module is not running.")
ErrNotSupported = errors.New("This component is not supported on this OS.")
reCmdSpaceCleaner = regexp.MustCompile(`^([^\s]+)\s+(.+)$`)
)