aboutsummaryrefslogtreecommitdiff
path: root/share/hydractl/sync-media
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2023-10-01 15:25:08 -0300
committerSilvio Rhatto <rhatto@riseup.net>2023-10-01 15:25:08 -0300
commit2f53236f2ea36ffac6e2e80da091574ae6f0d6c6 (patch)
tree68b77cd9552fc57939d619906dec489683c59935 /share/hydractl/sync-media
parent312470869f99b72b8d1ec68376b3288ce575db0f (diff)
downloadhydra-2f53236f2ea36ffac6e2e80da091574ae6f0d6c6.tar.gz
hydra-2f53236f2ea36ffac6e2e80da091574ae6f0d6c6.tar.bz2
Feat: hydractl: sync-media: support for specifying a repository in the command line (2)
Diffstat (limited to 'share/hydractl/sync-media')
-rwxr-xr-xshare/hydractl/sync-media4
1 files changed, 2 insertions, 2 deletions
diff --git a/share/hydractl/sync-media b/share/hydractl/sync-media
index 6486198..defa443 100755
--- a/share/hydractl/sync-media
+++ b/share/hydractl/sync-media
@@ -184,7 +184,7 @@ $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
+if [ ! -z "$REPOSITORY" ] && [ -d "$CACHE/$REPOSITORY" ] && ! echo "$REPOSITORY" | grep -q -- '--'; then
REPOSITORIES="$REPOSITORY"
else
REPOSITORIES="`ls $CACHE`"
@@ -246,7 +246,7 @@ done
# Process removable or remote media
if [ ! -z "$DRIVE" ] && [ -d "$VOLUME/$MEDIA" ]; then
# Check if a specific repository was passed via the command line
- if [ -z "$REPOSITORY" ] && [ -d "$VOLUME/$MEDIA/$REPOSITORY" ] && ! echo "$REPOSITORY" | grep -q '--'; then
+ if [ ! -z "$REPOSITORY" ] && [ -d "$VOLUME/$MEDIA/$REPOSITORY" ] && ! echo "$REPOSITORY" | grep -q -- '--'; then
REPOSITORIES="$REPOSITORY"
else
REPOSITORIES="`ls $VOLUME/$MEDIA`"