From 2f53236f2ea36ffac6e2e80da091574ae6f0d6c6 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 1 Oct 2023 15:25:08 -0300 Subject: Feat: hydractl: sync-media: support for specifying a repository in the command line (2) --- share/hydractl/sync-media | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share') 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`" -- cgit v1.2.3