Commit 098b4605 authored by Tomas Touceda's avatar Tomas Touceda
Browse files

Try removing the port.conf file before using auto as *Port

parent 4f0ebe51
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1069,9 +1069,13 @@ MainWindow::start()
  
  if(settings.getControlMethod() == ControlMethod::Port) {
    if(settings.autoControlPort()) {
      QString portconf = QString("%1/port.conf").arg(expDataDirectory);
      if(!QFile::remove(portconf))
        vWarn(QString("Unable to remove %s, may be it didn't existed.").arg(portconf));

      args << "ControlPort" << "auto";
      args << "SocksPort" << "auto";
      args << "ControlPortWriteToFile" << QString("%1/port.conf").arg(expDataDirectory);
      args << "ControlPortWriteToFile" << portconf;
    } else {
      /* Add the intended control port value */
      quint16 controlPort = settings.getControlPort();