05-02-2018, 12:30 PM
(05-02-2018, 09:50 AM)sjoerdju Wrote: Ok, it was rather easy:
Used https://www.tecmint.com/ssh-passwordless...asy-steps/ to set op the ssh.
The script:
Quote:osmc@osmc:~$ cat /usr/bin/cdtest
#!/bin/bash
LOGFILE=/var/log/cdrip.log
echo "$(date)" >> $LOGFILE
sleep 10
(
# Wait for lock on /var/lock/.audio-cd-rip.lock (fd 200) for two hours
flock -x -w 7200 200 || exit 1
abcde 2>&1 >> $LOGFILE
rc=$?
if [[ $rc != 0 ]] ; then
eject
exit $rc
fi
ssh pi@moode mpc update >> $LOGFILE
ssh pi@moode truncate /var/local/www/libcache.json --size 0
echo "LOG END" >> $LOGFILE
) 200>/var/lock/.audio-cd-rip.lock
If anybody wants to do something similar; make sure to use UDEV to trigger the ripping proces (other options won't work on the Pi).
Great!
By the way, this is a very cool automation. What ripping tool are you using? Are you satisfied with the track names and tags it assigns? I haven't found a tool yet I totally trust. Operas especially are a challenge and I have a bunch of classics on CD.
Regards,
Kent