diff options
-rw-r--r-- | files/sync-media-init | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/files/sync-media-init b/files/sync-media-init index 1310aa5..72ed9e1 100644 --- a/files/sync-media-init +++ b/files/sync-media-init @@ -8,8 +8,9 @@ BASENAME="`basename $0`" VOLUME="$1" DOMAIN="`facter DOMAIN`" HOST="`facter hostname`" +#LOCAL_BOXES="" +#LOCAL_VOLUMES="" #REMOTE_BOXES="" -#REMOTE_VOLUMES="" # Syntax check if [ -z "$VOLUME" ]; then @@ -31,23 +32,30 @@ for file in `ls $MEDIA`; do echo Processing "$MEDIA/$file..." cd $MEDIA/$file - echo "Removing origin..." - git remote rm origin + if git remotes | grep -q "^origin$"; then + echo "Removing origin..." + git remote rm origin + fi if [ ! -d "$MEDIA/$file/.git/annex" ]; then git annex init $VOLUME fi - for remote in $REMOTE_BOXES; do + for remote in $LOCAL_BOXES; do echo "Adding /var/cache/$remote/media/$file remote..." git remote add $remote /var/cache/$remote/media/$file done - for remote in $REMOTE_VOLUMES; do + for remote in $LOCAL_VOLUMES; do echo "Adding /media/$remote/media.$DOMAIN/$file..." git remote add $remote /media/$remote/media.$DOMAIN/$file done + for remote in $REMOTE_BOXES; do + echo "Adding /var/cache/$remote/media/$file remote..." + git remote add $remote ssh://$remote/var/cache/media/$file + done + echo "" ) fi |