Skip to content

Instantly share code, notes, and snippets.

@vajonam
Created September 28, 2018 16:31
Show Gist options
  • Save vajonam/6db2326e47b4ddd0d9c4f4a8abe430ca to your computer and use it in GitHub Desktop.
Save vajonam/6db2326e47b4ddd0d9c4f4a8abe430ca to your computer and use it in GitHub Desktop.
Sending a channel to broadlink
#!/bin/bash
channel="$1"
echo -n "Sending: "
cd /opt/rm3/mag_iptv
if mkdir /var/lock/rm3; then
for (( i=0; i<${#channel}; i++ )); do
letter=${channel:$i:1}
broadlink_cli --device @cogeco.device --send @$letter.iptv
echo -n $letter
sleep 0.5
done
broadlink_cli --device @cogeco.device --send @ok.iptv
echo "-ok"
# Throttle stuff
sleep 5;
rmdir /var/lock/rm3
else
echo "Lock failed - exit" >&2
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment