From: Silvio Rhatto Date: Sun, 1 Oct 2023 18:25:08 +0000 (-0300) Subject: Feat: hydractl: sync-media: support for specifying a repository in the command line (2) X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=2f53236f2ea36ffac6e2e80da091574ae6f0d6c6;p=hydra.git Feat: hydractl: sync-media: support for specifying a repository in the command line (2) --- 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`"