From b21512d5eaee693b98c3d2302719c58083bb2dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E6=B5=B7?= Date: Wed, 18 Sep 2019 14:19:29 +0800 Subject: [PATCH] fix function --- ddnspod.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ddnspod.sh b/ddnspod.sh index b870eee..85ad855 100755 --- a/ddnspod.sh +++ b/ddnspod.sh @@ -151,7 +151,7 @@ arDdnsCheck() { # See: http://stackoverflow.com/a/29835459/4449544 # Execute the function in a *subshell* to localize variables and the effect of `cd`. -rreadlink() ( +rreadlink() { target=$1 fname= targetDir= CDPATH= @@ -174,6 +174,7 @@ rreadlink() ( fi break # Ultimate target reached. done + targetDir=$(command pwd -P) # Get canonical dir. path # Output the ultimate target's canonical path. # Note that we manually resolve paths ending in /. and /.. to make sure we have a normalized path. @@ -186,7 +187,8 @@ rreadlink() ( else command printf '%s\n' "${targetDir%/}/$fname" fi -) + +} # Load config file