aboutsummaryrefslogtreecommitdiff
path: root/cmd/catbus-actuator-wakeonlan
diff options
context:
space:
mode:
authorEthel Morgan <eth@ethulhu.co.uk>2020-06-20 00:31:20 +0100
committerEthel Morgan <eth@ethulhu.co.uk>2020-06-20 00:31:20 +0100
commit5b9435bff8ce11bbbf720084e27c2c6f471934f6 (patch)
treed4eebdcb1222a8545ccd5478552b4ae70317fa87 /cmd/catbus-actuator-wakeonlan
parent0905fc55e7427a4e024fc5dc73f10be45200f110 (diff)
only send WOL packets when set to "on"
Diffstat (limited to '')
-rw-r--r--cmd/catbus-actuator-wakeonlan/main.go4
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