na een onderbreking toch nog eventjes terugkomen op deze;
Ik sla de randoms.sh nu op met Notepad++ als Unix met de EOL zoals je zei en ik heb nu geen problemen meer om de random5.sh zoals ik ze noemde, uit te voeren.
Echter er wordt nog steeds geen m3u file aangemaakt!
Ik ben ingelogd via Putty met Root en admin pw en zie via Dir:
-rwxr-xr-x 1 kurt users 1413 Nov 23 23:18 random5.sh
in de derde kolom, moet daar geen root of admin staan? Sommige bestanden van eerdere tests in die map hebben admin, allicht omdat ik toen met admin aangemeld was op de Synology?
Ik probeerde ook eventjes met 777: '-rwxrwxrwx 1 kurt', maar ook geen m3u file te zien.
Dat is mijn script file:
#!/bin/sh
# random5.sh
# this script will try to create a playlist with random songs, based on a SQL statement or file
# change the following values:
# BASE folder - this is were the SQLFILE is located and this script
BASE=/volume1/music/playlists/
# this is the output file - this is where the playlist resides in the filesystem
PLAYLIST=/volume1/music/playlists/random100.m3u
# Only change these values if your music library is located in another location
SEARCH="/volume1/music"
REPLACE=".."
# a better approach is to put the SQL statements into a file:
# there is more flexibility then and it is better readable
SQLFILE=$BASE/playlist.sql
# run the command, but only when the playlist file already exists.
if [ -f $PLAYLIST ] ; then
# this is with the SQL statements from a file
if [ -f $SQLFILE ] ; then
/usr/syno/pgsql/bin/psql -P pager=off -A -q -t -f $SQLFILE mediaserver admin | sed "s#$SEARCH#$REPLACE#" > $PLAYLIST
fi
else
exit
fi
# you should add the PLAYLIST file one time to Audiostation with the following command
#synoindex -a $PLAYLIST
# you can add the following line to the file /etc/crontab to run this file once every day, but remove the '#' in front of it
#5 6 * * * root /opt/etc/audiostation-stuff/random100.sh
# when done, restart the cron process with the following command
#/usr/syno/sbin/synoservicectl --restart crond