mirror of
https://github.com/bettercap/bettercap
synced 2025-07-10 07:13:36 -07:00
refact: refactored module status checks in Configure methods for consistency
This commit is contained in:
parent
a8e6b497a3
commit
1e7d99433e
13 changed files with 52 additions and 53 deletions
|
@ -83,7 +83,9 @@ func (p *TcpProxy) Configure() error {
|
|||
var proxyAddress string
|
||||
var scriptPath string
|
||||
|
||||
if err, address = p.StringParam("tcp.address"); err != nil {
|
||||
if p.Running() == true {
|
||||
return session.ErrAlreadyStarted
|
||||
} else if err, address = p.StringParam("tcp.address"); err != nil {
|
||||
return err
|
||||
} else if err, proxyAddress = p.StringParam("tcp.proxy.address"); err != nil {
|
||||
return err
|
||||
|
@ -190,9 +192,7 @@ func (p *TcpProxy) handleConnection(c *net.TCPConn) {
|
|||
}
|
||||
|
||||
func (p *TcpProxy) Start() error {
|
||||
if p.Running() == true {
|
||||
return session.ErrAlreadyStarted
|
||||
} else if err := p.Configure(); err != nil {
|
||||
if err := p.Configure(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue