I have a script for following a log file to determine if a server has started, and it goes something like this:

```
echo "Starting server."
./start_server.sh

sleeptime=0
while [ ${sleeptime} -lt 60 ]
do
    sleep 5

    serverlog=$(tail -n 5 ./server.log)
    echo ${serverlog} | grep -iq "Server startup"

    if [ $? = 0 ]
    then
        echo "Server startup successful"
        exit 0
    fi

    let sleeptime=sleeptime+5
done

echo "Warning: server startup status unknown."
exit 1

```

When I run the script (./start\_server.sh), the script exits fine. However, when I pipeline it to tee (./start\_server.sh | tee -a serverstartup.log), the script doesn't end unless I force it (ctrl + C).

Why doesn't the script exit when pipelined to tee?