Created
May 8, 2018 08:17
-
-
Save balcsida/33d5cba90dbc3eed3f401d321a8c684f to your computer and use it in GitHub Desktop.
Send commands to multiple WebOS TVs with LGWebOSRemote
This file contains 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 | |
for filename in /home/pi/tvs/*.json; do | |
echo "-- $filename" | |
IP_ADDRESS="$(jq --raw-output '.ip' $filename)" | |
if ping -c1 $IP_ADDRESS 1>/dev/null 2>/dev/null | |
then | |
echo " Ping success" | |
cp $filename ~/.lgtv.json | |
/home/pi/LGWebOSRemote/lgtv.sh "$@" | |
else | |
echo " Ping failed" | |
fi | |
echo "--" | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment