05-02-2018, 09:50 AM
Ok, it was rather easy:
Used https://www.tecmint.com/ssh-passwordless...asy-steps/ to set op the ssh.
The script:
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).
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).