Added support for hostname and port in patchdb script

Both hostname and port number are set as optional and will use defaults unless specified.