From fda68481bfcb2119788006f47dc0dd3d096109f7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 2 Oct 2015 19:51:26 -0300 Subject: More fixes into sync-media --- files/sync-media | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'files') diff --git a/files/sync-media b/files/sync-media index 27ca5af..6cdbc00 100644 --- a/files/sync-media +++ b/files/sync-media @@ -149,7 +149,7 @@ if [ -d "$CACHE" ]; then cd $VOLUME/$MEDIA echo "Initializing $VOLUME/$MEDIA/$folder..." git clone $CACHE/$folder && cd $folder && sync_media_identity && git annex init $DRIVE && \ - cd $CACHE/$folder && git remote add $DRIVE $VOLUME/$MEDIA/$folder + git remote rename origin $HOST && cd $CACHE/$folder && git remote add $DRIVE $VOLUME/$MEDIA/$folder ) fi elif [ ! -d "$VOLUME/$MEDIA/$folder" ]; then @@ -181,6 +181,14 @@ if [ ! -z "$DRIVE" ] && [ -d "$VOLUME/$MEDIA" ]; then git remote add $HOST $CACHE/$folder fi + # If there is a playlists folder, make sure mpd user can write to it + if [ -d "playlists" ]; then + $sudo chmod 775 playlists + $sudo chown -R mpd.audio playlists + find playlists -type f -exec sudo chmod 664 {} \; + find playlists -type d -exec sudo chmod 775 {} \; + fi + sync_media_identity sync_media_add git annex sync -- cgit v1.2.3