From: Silvio Rhatto Date: Thu, 17 Mar 2016 12:40:33 +0000 (-0300) Subject: Ensure we have a reference to the remote repository at sync-media X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=135d249ee64b4af139329e8d06646b3772dd2fa7;p=puppet-backup.git Ensure we have a reference to the remote repository at sync-media --- diff --git a/files/sync-media b/files/sync-media index 6864e2b..64e3f02 100644 --- a/files/sync-media +++ b/files/sync-media @@ -106,6 +106,14 @@ if [ -d "$CACHE" ]; then find playlists -type d -exec sudo chmod 775 {} \; fi + # Ensure we have a reference to the remote repository + if [ -d "$VOLUME/$MEDIA/$folder/git/.annex" ]; then + # Check remote + if ! git remote | grep -q "^$REMOTE$"; then + git remote add $REMOTE $VOLUME/$MEDIA/$folder + fi + fi + sync_media_identity sync_media_add git annex sync