blue-merle/files/etc/gl-switch.d/sim.sh
Tobias Mueller 259bffc515 switch: show a message on toggling the button
To see more easily whether we have control.
2023-10-16 16:10:17 +02:00

21 lines
399 B
Bash

#!/bin/sh
. /lib/functions/gl_util.sh
action=$1
logger -p notice -t blue-merle-toggle "Called... ${action}"
if [ "$action" = "on" ];then
mcu_send_message "Blue Merle ${action}"
echo "on" > /tmp/sim_change_switch
elif [ "$action" = "off" ];then
mcu_send_message "Blue Merle ${action}"
echo "off" > /tmp/sim_change_switch
else
echo "off" > /tmp/sim_change_switch
fi
sleep 1