Created
September 28, 2018 16:31
-
-
Save vajonam/6db2326e47b4ddd0d9c4f4a8abe430ca to your computer and use it in GitHub Desktop.
Sending a channel to broadlink
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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