From f074cb1036c42d12da375ab53316a707eaa30208 Mon Sep 17 00:00:00 2001 From: neil Date: Sat, 23 Jan 2016 09:59:18 +0800 Subject: [PATCH] fix bug for webroot mode. The token was missing. --- le.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/le.sh b/le.sh index 30ff294..e024395 100755 --- a/le.sh +++ b/le.sh @@ -602,13 +602,17 @@ issue() { wellknown_path="$Le_Webroot/.well-known/acme-challenge" fi _debug wellknown_path "$wellknown_path" - + + token="$(echo -e -n "$keyauthorization" | cut -d '.' -f 1)" + _debug "writing token:$token to $wellknown_path/$token" + + mkdir -p "$wellknown_path" + echo -n "$keyauthorization" > "$wellknown_path/$token" + webroot_owner=$(stat -c '%U:%G' $Le_Webroot) _debug "Changing owner/group of .well-known to $webroot_owner" chown -R $webroot_owner "$Le_Webroot/.well-known" - mkdir -p "$wellknown_path" - echo -n "$keyauthorization" > "$wellknown_path/$token" fi fi