What your routine is lacking is some way to exit once the correct i is found.
For that you can look at the exit code given back from curl:

for i in {2000..3000}
do 
  curl http://admin:$i@mywebsite.com/link
  if [ "$?" -eq 0 ]; then
    echo Found "$i"
    break
  fi
done


The exit value of curl is 0 when everything is correct and can be checked directly after the program stops by inspecting the special variable $?.
Use man curl and search for EXIT CODE to see all the different things curl can tell you with its exit code.

How can I login to a website from terminal?
This is probably easy, but I was just wondering if there is a nice and easy formula for the topological Euler characteristic of a K3 surface $X$ with say $k$ nodes.  If there is no general formula, is it known what the answer is for $k=1$?
