mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
refact: refactored module SetRunning method (fixes #49)
This commit is contained in:
parent
76d6977967
commit
9c6eb70eb3
15 changed files with 103 additions and 174 deletions
|
@ -101,11 +101,11 @@ func buildPayload(mac string) []byte {
|
|||
}
|
||||
|
||||
func (w *WOL) wolETH(mac string) error {
|
||||
w.SetRunning(true, nil)
|
||||
defer w.SetRunning(false, nil)
|
||||
|
||||
payload := buildPayload(mac)
|
||||
log.Info("Sending %d bytes of ethernet WOL packet to %s", len(payload), core.Bold(mac))
|
||||
w.SetRunning(true)
|
||||
defer w.SetRunning(false)
|
||||
|
||||
eth := layers.Ethernet{
|
||||
SrcMAC: w.Session.Interface.HW,
|
||||
DstMAC: layers.EthernetBroadcast,
|
||||
|
@ -126,10 +126,11 @@ func (w *WOL) wolETH(mac string) error {
|
|||
}
|
||||
|
||||
func (w *WOL) wolUDP(mac string) error {
|
||||
w.SetRunning(true, nil)
|
||||
defer w.SetRunning(false, nil)
|
||||
|
||||
payload := buildPayload(mac)
|
||||
log.Info("Sending %d bytes of UDP WOL packet to %s", len(payload), core.Bold(mac))
|
||||
w.SetRunning(true)
|
||||
defer w.SetRunning(false)
|
||||
|
||||
eth := layers.Ethernet{
|
||||
SrcMAC: w.Session.Interface.HW,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue