From 0d1b271dbaa128d20d448f132e2db6626eb96876 Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Sun, 10 Dec 2023 19:24:19 +0100 Subject: [PATCH] sync.sh: Test if nothing to do --- bash/sync.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bash/sync.sh b/bash/sync.sh index 15f9f84..c83f105 100755 --- a/bash/sync.sh +++ b/bash/sync.sh @@ -498,6 +498,9 @@ parse_opts() { [[ -f "$_backup_dir/.syncrc" ]] && _config=${_config:-"$_backup_dir/.syncrc"} fi + # We do not know what to do... + [[ -z "$_config" ]] && usage + # see https://unix.stackexchange.com/questions/406216 CONFIG=$(realpath -sm "$_config") if [[ -z "$CONFIG" ]]; then @@ -507,7 +510,7 @@ parse_opts() { printf "%s: Cannot open %s file\n" "$CMDNAME" "$CONFIG" exit 9 fi - # shellcheck source=sync-conf-example.sh + # shellcheck source=share/sync/sync-conf-example.sh source "$CONFIG" # _backup_dir takes precedence on SOURCEDIR (useless ?)