Skip to content

Instantly share code, notes, and snippets.

@HugoPoi
Last active January 28, 2017 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HugoPoi/0c55a2096dffccf62fe3677c1acbc4d3 to your computer and use it in GitHub Desktop.
Save HugoPoi/0c55a2096dffccf62fe3677c1acbc4d3 to your computer and use it in GitHub Desktop.
iot failed to secure things, today i choose to pilote my thing with a file injected in a shell script running as root
http://192.168.1.97:8081/|-20
while true; do
conf=$(wget -q -O - http://192.168.1.97:8888/madplay.conf)
streamadr=$(echo $conf | cut -f1 -d\|)
volume=$(echo $conf | cut -f2 -d\|)
echo $streamadr
echo $volume
if [[ -z $streamadr ]];
then killall madplay;
else madplay_process_id=$(pidof madplay)
if [[ -z $madplay_process_id ]]; then
wget -q -O - $streamadr | madplay -a $volume - &
fi
fi;
echo "Wait for 10 seconds"
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment