From 088b7f360e8418c01578fac5c0c21230b91381b9 Mon Sep 17 00:00:00 2001 From: "Raphael D. Pinheiro" Date: Thu, 23 Feb 2017 13:25:33 -0300 Subject: [PATCH] enhance regex to allow multiple dots in file names things like mydomain.com.crt and mydomain.com.key will be better interpreted --- plugins/certs/subcommands/add | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/certs/subcommands/add b/plugins/certs/subcommands/add index c705d1cde..69ba70721 100755 --- a/plugins/certs/subcommands/add +++ b/plugins/certs/subcommands/add @@ -44,7 +44,7 @@ certs_set() { trap 'popd &> /dev/null || true; rm -rf $CERTS_SET_TMP_WORK_DIR > /dev/null' RETURN tar xvf - <&0 - local CRT_FILE_SEARCH=$(find . -not -path '*/\.*' -type f -name "*.crt") + local CRT_FILE_SEARCH=$(find . -not -path '*/\.*' -type f -name ".crt$") local CRT_FILE_COUNT=$(printf "%s" "$CRT_FILE_SEARCH" | grep -c '^') if [[ $CRT_FILE_COUNT -lt 1 ]]; then dokku_log_fail "Tar archive is missing .crt file" @@ -54,7 +54,7 @@ certs_set() { local CRT_FILE=$CRT_FILE_SEARCH fi - local KEY_FILE_SEARCH=$(find . -not -path '*/\.*' -type f -name "*.key") + local KEY_FILE_SEARCH=$(find . -not -path '*/\.*' -type f -name "*.key$") local KEY_FILE_COUNT=$(printf "%s" "$KEY_FILE_SEARCH" | grep -c '^') if [[ $KEY_FILE_COUNT -lt 1 ]]; then dokku_log_fail "Tar archive is missing .key file"