Check that file is fully downloaded by FTP
You definitely need more quoting of parameter expansions.  Notably, $FTP_PASSWORD may well contain characters that are meaningful to the shell:

FileSizeOnServer=$(curl --max-time 10 -u "$FTP_USER:$FTP_PASSWORD" \
                   --head "$FTP_Path" 2&gt;&amp;1 | grep "Content-Length:")


I'm not sure it's a good idea to redirect standard error there - you want errors to be visible, not piped into grep.

I'm not sure there's much value to the size comparison, though - curl should exit with non-zero status if it didn't transfer the whole file, so we should just use it directly:

if ! curl -u "$FTP_USER:$FTP_PASSWORD" "$FTP_Path"
then
    echo "Failed to download" &gt;&amp;2
    exit 1
fi


Or even simply

set -e
curl -u "$FTP_USER:$FTP_PASSWORD" "$FTP_Path"