You can specify the listening ports as arguments (0 disables listening), default is 4444:
$ ./startAgent.sh --udp-port 0 --tcp-port 3450