From 18e46962c2c26c676b31a26f196f078aa26b0a3d Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 22 Sep 2016 13:15:25 +0800 Subject: [PATCH] fix https://github.com/Neilpang/acme.sh/issues/297 --- acme.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/acme.sh b/acme.sh index b9f69bc9..91557b8d 100755 --- a/acme.sh +++ b/acme.sh @@ -1244,12 +1244,20 @@ _starttlsserver() { _debug serverproc $serverproc } +#file +_readlink() { + _rf="$1" + if ! readlink -f "$_rf" 2>/dev/null; then + readlink "$_rf" + fi +} + __initHome() { if [ -z "$_SCRIPT_HOME" ] ; then if _exists readlink && _exists dirname ; then _debug "Lets guess script dir." _debug "_SCRIPT_" "$_SCRIPT_" - _script="$(readlink -f "$_SCRIPT_")" + _script="$(_readlink "$_SCRIPT_")" _debug "_script" "$_script" _script_home="$(dirname "$_script")" _debug "_script_home" "$_script_home"