local remote="$1"
local path="$2"
- if [ -z "$remote" ] || [ -z "$path" ]; then
+ if [ -z "$remote" ] || [ "$remote" == "local" ] || [ -z "$path" ]; then
return
fi
#$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
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
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