From b8004afe62816135f4f7b011ae2571d1e8744e44 Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Thu, 28 May 2020 17:31:55 +0200 Subject: [PATCH] * Fixed bug in sftp_file(): when file does not contain a directory path, the $TRANSFER_DIR was wrongly calculated * Fixed wrong filename in distribute2host() --- manage_ssh.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manage_ssh.sh b/manage_ssh.sh index 54f4d5c..53a9ad8 100644 --- a/manage_ssh.sh +++ b/manage_ssh.sh @@ -43,7 +43,7 @@ # or LOCAL_CONFIG_FILE instead # define the version (YYYY-MM-DD) -typeset -r SCRIPT_VERSION="2018-11-03" +typeset -r SCRIPT_VERSION="2020-05-28" # name of the global configuration file (script) typeset -r GLOBAL_CONFIG_FILE="manage_ssh.conf" # name of the local configuration file (script) @@ -734,7 +734,7 @@ else fi # discover a keys blacklist file, also copy it across if we find one # never use a keys blacklist file from the local config though -[[ -r ${LOCAL_DIR}/keyupdate.conf ]] && \ +[[ -r ${LOCAL_DIR}/update_ssh.conf ]] && \ BLACKLIST_FILE="$(grep -E -e '^blacklist_file' ${LOCAL_DIR}/update_ssh.conf 2>/dev/null | cut -f2 -d'=')" if [[ -n "${BLACKLIST_FILE}" ]] then @@ -1257,7 +1257,7 @@ typeset OLD_PWD="" typeset SFTP_RC=0 # find the local directory & permission bits -TRANSFER_DIR="${TRANSFER_FILE%/*}" +TRANSFER_DIR=$(dirname "${TRANSFER_FILE%%!*}") TRANSFER_PERMS="${TRANSFER_FILE##*!}" # cut out the permission bits and the directory path TRANSFER_FILE="${TRANSFER_FILE%!*}"