aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2023-10-01 15:44:05 -0300
committerSilvio Rhatto <rhatto@riseup.net>2023-10-01 15:44:05 -0300
commit4b2f714a50930579cef7cafda9eecfc2c54f0e0f (patch)
treea26f2ab8b3638bd86efd5fb8acd2610faca23bd2
parent84d059366bb694d200f9f69e8fbacde6558aab67 (diff)
downloadhydra-4b2f714a50930579cef7cafda9eecfc2c54f0e0f.tar.gz
hydra-4b2f714a50930579cef7cafda9eecfc2c54f0e0f.tar.bz2
Feat: hydractl: sync-media: support for 'local' drive (2)
-rwxr-xr-xshare/hydractl/sync-media9
1 files changed, 6 insertions, 3 deletions
diff --git a/share/hydractl/sync-media b/share/hydractl/sync-media
index a69932e..14dd0e9 100755
--- a/share/hydractl/sync-media
+++ b/share/hydractl/sync-media
@@ -129,7 +129,7 @@ function sync_media_ensure_remote {
local remote="$1"
local path="$2"
- if [ -z "$remote" ] || [ -z "$path" ]; then
+ if [ -z "$remote" ] || [ "$remote" == "local" ] || [ -z "$path" ]; then
return
fi
@@ -182,7 +182,6 @@ mkdir -p $CACHE
#$sudo find $CACHE -type d -exec chmod 755 {} \;
$sudo chown $WHOAMI. $CACHE
$sudo chown $WHOAMI. $CACHE/*
-sync_media_incoming_perms
# Check if a specific repository was passed via the command line
if [ ! -z "$REPOSITORY" ] && [ -d "$CACHE/$REPOSITORY" ] && ! echo "$REPOSITORY" | grep -q -- '--'; then
@@ -191,6 +190,10 @@ else
REPOSITORIES="`ls $CACHE`"
fi
+if echo $REPOSITORIES | grep "incoming"; then
+ sync_media_incoming_perms
+fi
+
# Iterate over existing repositories in the local cache
for folder in $REPOSITORIES; do
# Sync each repository in the local cache
@@ -346,7 +349,7 @@ if [ ! -z "$DRIVE" ] && [ -d "$VOLUME/$MEDIA" ]; then
fi
fi
done
-elif [ ! -z "$REMOTE" ]; then
+elif [ ! -z "$REMOTE" ] && [ "$REMOTE" != "local" ]; then
# Try to copy to a remote
for folder in `ls $CACHE`; do
if [ -d "$CACHE/$folder/.git/annex" ]; then