Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Update sources from command line?
#5
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).
Reply


Messages In This Thread
Update sources from command line? - by sjoerdju - 05-01-2018, 12:26 PM
RE: Update sources from command line? - by sjoerdju - 05-02-2018, 09:50 AM
RE: Update sources from command line? - by DRONE7 - 05-03-2018, 10:22 PM
RE: Update sources from command line? - by DRONE7 - 05-10-2018, 06:20 AM

Forum Jump: