From d62ee94019cb16af6abca1187271f310fdbea215 Mon Sep 17 00:00:00 2001 From: neil Date: Mon, 4 Apr 2016 22:37:58 +0800 Subject: [PATCH] fix issue for apache mode: fix case when the httpdconf is absolute path. --- le.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/le.sh b/le.sh index 4bad707d..b3ed7cab 100755 --- a/le.sh +++ b/le.sh @@ -723,9 +723,14 @@ _initpath() { _apachePath() { - httpdroot="$(apachectl -V | grep HTTPD_ROOT= | cut -d = -f 2 | tr -d '"' )" httpdconfname="$(apachectl -V | grep SERVER_CONFIG_FILE= | cut -d = -f 2 | tr -d '"' )" - httpdconf="$httpdroot/$httpdconfname" + if [[ "$httpdconfname" == '/'* ]] ; then + httpdconf="$httpdconfname" + else + httpdroot="$(apachectl -V | grep HTTPD_ROOT= | cut -d = -f 2 | tr -d '"' )" + httpdconf="$httpdroot/$httpdconfname" + fi + if [ ! -f $httpdconf ] ; then _err "Apache Config file not found" $httpdconf return 1