ignore trailing slashes for comparison of source

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2014-03-11 22:16:08 +01:00
parent 301b4e18ff
commit 5ec617fa3e

View file

@ -35,7 +35,8 @@ case "$type" in
cd "$destination_dir"
source_is=$(ls -l "$destination" | sed 's/.*-> //g')
if [ -h "$destination" ]; then
if [ "$source_is" = "$source" ]; then
# ignore trailing slashes for comparison
if [ "${source_is%/}" = "${source%/}" ]; then
echo present
else
echo wrongsource