Skip to content

Instantly share code, notes, and snippets.

@dylanmaryk
Created March 20, 2016 13:03
Show Gist options
  • Save dylanmaryk/bcbe4a7d4ed87a5ee95c to your computer and use it in GitHub Desktop.
Save dylanmaryk/bcbe4a7d4ed87a5ee95c to your computer and use it in GitHub Desktop.
while true
do
$(inotifywait -e close_write,moved_to,create /var/www/insanityradio.com/www/wordpress/nowplaying)
sleep 1
song=$(sed "1!d" /var/www/insanityradio.com/www/wordpress/nowplaying/output.txt)
song=${song::-1}
artist=$(sed "2!d" /var/www/insanityradio.com/www/wordpress/nowplaying/output.txt)
artist=${artist::-1}
ruby output.rb "$song" "$artist"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment