#!/bin/sh
. /usr/local/pisound/scripts/common/common.sh
# Use websocket interface to mod-ui as the regular socket is exclusively used for
# communication between mod-ui and mod-host.
if [ -z $(echo -n '' | /usr/local/bin/websocat --text ws://127.0.0.1:80/websocket/ | grep 'transport 1') ]; then
# Start transport and blinking
echo 'transport-rolling 1' | /usr/local/bin/websocat ws://127.0.0.1:80/websocket/
else
# Stop transport and blinking
echo 'transport-rolling 0' | /usr/local/bin/websocat ws://127.0.0.1:80/websocket/
fi