From ee2737383bb13103a0a1b54a21234597f57ec437 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 10 Feb 2016 08:18:11 +0000 Subject: [PATCH] fix challenge token location Due to the call to create the destination directory via 'mkdir -p "$(dirname "$to")"', the copy_file_to_location function requires a filename and not the directory as a destination. Use copy_file_to_location as it appears to be intended and check the exit status from the `cp' invocation for failures. --- getssl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/getssl b/getssl index 53ee545..0c84dc6 100755 --- a/getssl +++ b/getssl @@ -347,6 +347,9 @@ copy_file_to_location() { # copies a file, using scp if required. error_exit "cannot create ACL directory $(basename "$to")" fi cp "$from" "$to" + if [ $? -ne 0 ]; then + error_exit "cannot copy $from to $to" + fi fi debug "copied $from to $to" fi @@ -855,7 +858,7 @@ for d in $alldomains; do # copy to token to acme challenge location debug "copying file from $TEMP_DIR/$token to ${ACL[$dn]}" - copy_file_to_location "challenge token" "$TEMP_DIR/$token" "${ACL[$dn]}" + copy_file_to_location "challenge token" "$TEMP_DIR/$token" "${ACL[$dn]}/$token" wellknown_url="http://$d/.well-known/acme-challenge/$token" debug wellknown_url "$wellknown_url"