sodface wrote:
>
> >
Code:
--------------------
> >
> cp /var/log/pcp_squeezelite.log last.log
> while :
> do
> if `cmp -s /var/log/pcp_squeezelite.log last.log`
> then
> sleep .3
> else
> cp /var/log/pcp_squeezelite.log last.log
> (echo -e "$post"; sleep .1) | nc 192.168.1.201 9000 | tail --line=+7 | awk
-f /usr/local/bin/JSON.awk - | grep -m 1 '0,"title"' | cut -f2 | cut -d '"' -f2
> fi
> done
>
--------------------
> >
>
More efficient way:
Code:
--------------------
LASTT=0
while true; do
MODT=$(stat -c "%Y" /var/log/pcp_squeezelite.log)
if [ $MODT -ne $LASTT ]; then
LASTT=$MODT
echo "file changed at $MODT"
fi
sleep 1
done
--------------------
SW: 'Web UI for LMS'
(http://forums.slimdevices.com/showthread.php?98186-Announce-Alternative-Web-Interface-(beta))
| 'Playlist Editor / Generator'
(http://forums.slimdevices.com/showthread.php?108199-Announce-LMS-Playlist-Editor)
| 'Music Classification'
(http://forums.slimdevices.com/showthread.php?108278-Announce-Essentia-Integration-music-classification-(moods-genres-))
| 'Similar Music'
(http://forums.slimdevices.com/showthread.php?108495-Announce-LMSmusly-play-similar-music)
| 'LMSlib2go' (https://www.nexus0.net/pub/sw/lmslib2go/)
HowTos: 'build a self-contained LMS'
(http://forums.slimdevices.com/showthread.php?99648-Howto-build-a-self-contained-LMS)
| 'Ogg Opus'
(http://forums.slimdevices.com/showthread.php?107011-Howto-play-Ogg-Opus-files)
| 'Bluetooth/ALSA'
(http://forums.slimdevices.com/showthread.php?107230-Howto-Bluetooth-streaming-to-from-LMS-(ALSA-only-no-PulseAudio))
------------------------------------------------------------------------
Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=109694
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix