Check link target - do nothing if link is already created and the target matches the request. From Freddie Chopin.
This commit is contained in:
parent
0ef0793bf9
commit
6fd018089c
|
@ -51,6 +51,15 @@ fi
|
|||
# report that it does not exist.
|
||||
|
||||
if [ -h "${dest}" ]; then
|
||||
|
||||
# If the link is already created (and matches the request) do nothing
|
||||
|
||||
if [ "$(readlink ${dest})" = "${src}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Otherwise, remove the link
|
||||
|
||||
rm -f "${dest}"
|
||||
else
|
||||
|
||||
|
|
Loading…
Reference in New Issue