diff options
author | Ethel Morgan <eth@ethulhu.co.uk> | 2020-06-20 00:31:20 +0100 |
---|---|---|
committer | Ethel Morgan <eth@ethulhu.co.uk> | 2020-06-20 00:31:20 +0100 |
commit | 5b9435bff8ce11bbbf720084e27c2c6f471934f6 (patch) | |
tree | d4eebdcb1222a8545ccd5478552b4ae70317fa87 | |
parent | 0905fc55e7427a4e024fc5dc73f10be45200f110 (diff) |
only send WOL packets when set to "on"
Diffstat (limited to '')
-rw-r--r-- | cmd/catbus-actuator-wakeonlan/main.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/catbus-actuator-wakeonlan/main.go b/cmd/catbus-actuator-wakeonlan/main.go index ada08a0..53da4d9 100644 --- a/cmd/catbus-actuator-wakeonlan/main.go +++ b/cmd/catbus-actuator-wakeonlan/main.go @@ -51,6 +51,10 @@ func main() { for topic := range config.MACsByTopic { token := broker.Subscribe(topic, mqtt.AtLeastOnce, func(_ mqtt.Client, msg mqtt.Message) { + if string(msg.Payload()) != "on" { + return + } + mac, ok := config.MACsByTopic[msg.Topic()] if !ok { return |