You can check if the file is a link or not with either -h
or -L
:
if [ -L "$your_file" ]; then
echo "this is a link"
fi
Or shorter,
[ -L "$your_file" ] && echo "this is a link"
From man test
-h FILE
FILE exists and is a symbolic link (same as -L)
-L FILE
FILE exists and is a symbolic link (same as -h)