aboutsummaryrefslogtreecommitdiff
path: root/files/sync-media-init
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-05-31 17:28:49 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-05-31 17:28:49 -0300
commit92600a1bfa402b596abb2e04bb51d565e9d5bf5e (patch)
treeb83a8dda97a2b18267162eb6d626cedd32303447 /files/sync-media-init
parent52ea3de1a27ffa02ebf017a8abea7b3b87bafa60 (diff)
downloadpuppet-backup-92600a1bfa402b596abb2e04bb51d565e9d5bf5e.tar.gz
puppet-backup-92600a1bfa402b596abb2e04bb51d565e9d5bf5e.tar.bz2
Fixes on sync-media-init
Diffstat (limited to 'files/sync-media-init')
-rw-r--r--files/sync-media-init18
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