aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-09-27 22:46:10 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-09-27 22:46:10 -0300
commit9a4fd039c1206fb79b9b4f098fe4e34474e1907d (patch)
treed67630d3ee1d19add471656c09a82e0cbcf08baf
parent214b919659d3a1cd606308ba52ace5c6380b6df8 (diff)
downloadhydra-9a4fd039c1206fb79b9b4f098fe4e34474e1907d.tar.gz
hydra-9a4fd039c1206fb79b9b4f098fe4e34474e1907d.tar.bz2
Fix: hydractl sync-media-export logic
-rwxr-xr-xshare/hydractl/sync-media-export7
1 files changed, 2 insertions, 5 deletions
diff --git a/share/hydractl/sync-media-export b/share/hydractl/sync-media-export
index 8cf44cb..23e9a8d 100755
--- a/share/hydractl/sync-media-export
+++ b/share/hydractl/sync-media-export
@@ -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/ && \