]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix: hydractl: sync-media: allow 'localhost' to be set as the remote host
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 7 Jun 2024 11:43:10 +0000 (12:43 +0100)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 7 Jun 2024 11:43:10 +0000 (12:43 +0100)
share/hydractl/sync-media

index 742123e03b44c402c1f16f9bf478f0760ffbf40d..554e09aaf41ccf2b84a8213cc3aa3459065cde71 100755 (executable)
@@ -136,7 +136,7 @@ function sync_media_ensure_remote {
   local remote="$1"
   local path="$2"
 
-  if [ -z "$remote" ] || [ "$remote" == "local" ] || [ -z "$path" ]; then
+  if [ -z "$remote" ] || [ "$remote" == "local" ] || [ "$remote" == "localhost" ] || [ -z "$path" ]; then
     return
   fi
 
@@ -172,7 +172,7 @@ fi
 
 # Set drive config
 # Ingore drive/volume if it's set to "local"
-if [ ! -z "$REMOTE" ] && [ "$REMOTE" != "local" ]; then
+if [ ! -z "$REMOTE" ] && [ "$REMOTE" != "local" ] && [ "$REMOTE" != "localhost" ]; then
   # Check storage media
   MOUNT="`mount | grep $VOLUME`"
   if [ ! -z "$MOUNT" ]; then
@@ -382,7 +382,7 @@ if [ ! -z "$DRIVE" ] && [ -d "$VOLUME/$MEDIA" ]; then
       fi
     fi
   done
-elif [ ! -z "$REMOTE" ] && [ "$REMOTE" != "local" ]; then
+elif [ ! -z "$REMOTE" ] && [ "$REMOTE" != "local" ] && [ "$REMOTE" != "localhost" ]; then
   # Try to copy to a remote
   for folder in `ls $CACHE`; do
     if [ -d "$CACHE/$folder/.git/annex" ]; then