2023-10-16 10:14:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-10-16 14:10:17 +00:00
|
|
|
. /lib/functions/gl_util.sh
|
|
|
|
|
2023-10-16 10:14:00 +00:00
|
|
|
action=$1
|
|
|
|
|
2023-10-16 14:03:11 +00:00
|
|
|
logger -p notice -t blue-merle-toggle "Called... ${action}"
|
|
|
|
|
2023-10-16 10:14:00 +00:00
|
|
|
if [ "$action" = "on" ];then
|
2023-10-16 14:10:17 +00:00
|
|
|
mcu_send_message "Blue Merle ${action}"
|
2023-10-16 10:14:00 +00:00
|
|
|
echo "on" > /tmp/sim_change_switch
|
|
|
|
|
|
|
|
elif [ "$action" = "off" ];then
|
2023-10-16 14:10:17 +00:00
|
|
|
mcu_send_message "Blue Merle ${action}"
|
2023-10-16 10:14:00 +00:00
|
|
|
echo "off" > /tmp/sim_change_switch
|
2023-10-16 14:10:17 +00:00
|
|
|
|
2023-10-16 10:14:00 +00:00
|
|
|
else
|
|
|
|
echo "off" > /tmp/sim_change_switch
|
|
|
|
fi
|
|
|
|
sleep 1
|