From e860f1c79273731382f0c788ef1b462c6cbb8adc Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 2 Nov 2018 14:35:06 +0100 Subject: [PATCH] Determine source_is only if destination is symlink. --- cdist/conf/type/__link/explorer/state | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/conf/type/__link/explorer/state b/cdist/conf/type/__link/explorer/state index a601d53b..7150df25 100755 --- a/cdist/conf/type/__link/explorer/state +++ b/cdist/conf/type/__link/explorer/state @@ -33,8 +33,8 @@ destination_dir="${destination%/*}" case "$type" in symbolic) cd "$destination_dir" || exit 1 - source_is=$(readlink "$destination") if [ -h "$destination" ]; then + source_is=$(readlink "$destination") # ignore trailing slashes for comparison if [ "${source_is%/}" = "${source%/}" ]; then echo present