]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix: hydractl sync-media-export logic
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 28 Sep 2020 01:46:10 +0000 (22:46 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 28 Sep 2020 01:46:10 +0000 (22:46 -0300)
share/hydractl/sync-media-export

index 8cf44cbc7846b88a3df852bd1b0e7ccd1a9baf0f..23e9a8d9a706dcac97566c82c7d024c55e9baf33 100755 (executable)
@@ -27,11 +27,8 @@ for file in `ls $MEDIA`; do
     if [ ! -d "$DESTINATION" ]; then
       if ssh $DESTINATION if [ -d \"/var/cache/media/$file\" ] \; then echo exists\; fi | grep -q exists; then
         echo "Remote $file already exists, skipping..."
-        continue;
-      fi
-
-      # If remote destination, add a git post-receive hook
-      if [ -d "$file/.git" ]; then
+      elif [ -d "$file/.git" ]; then
+        # If remote destination, add a git post-receive hook
         git clone $file $file.git && \
           cp -a $APP_BASE/lib/hydra/hooks/post-receive $file.git/.git/hooks/post-receive && \
           rsync -avz $file.git/ $DESTINATION:/var/cache/media/$file/ && \