Restart IPSec service before VPN connect

This commit is contained in:
Mykola Baibuz 2024-08-29 23:18:21 +03:00
parent ad61ef0b22
commit 3cec0dc2a7
2 changed files with 5 additions and 6 deletions

View file

@ -45,7 +45,6 @@ void Ikev2Protocol::stop()
qDebug() << "IpsecProtocol::stop()"; qDebug() << "IpsecProtocol::stop()";
} }
void Ikev2Protocol::readIkev2Configuration(const QJsonObject &configuration) void Ikev2Protocol::readIkev2Configuration(const QJsonObject &configuration)
{ {
QJsonObject ikev2_data = configuration.value(ProtocolProps::key_proto_config_data(Proto::Ikev2)).toObject(); QJsonObject ikev2_data = configuration.value(ProtocolProps::key_proto_config_data(Proto::Ikev2)).toObject();

View file

@ -311,7 +311,7 @@ bool IpcServer::disableKillSwitch()
bool IpcServer::startIPsec(QString tunnelName) bool IpcServer::startIPsec(QString tunnelName)
{ {
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
/* QProcess processSystemd; QProcess processSystemd;
QStringList commandsSystemd; QStringList commandsSystemd;
commandsSystemd << "systemctl" << "restart" << "ipsec"; commandsSystemd << "systemctl" << "restart" << "ipsec";
processSystemd.start("sudo", commandsSystemd); processSystemd.start("sudo", commandsSystemd);
@ -327,8 +327,8 @@ bool IpcServer::startIPsec(QString tunnelName)
} }
commandsSystemd.clear(); commandsSystemd.clear();
QThread::msleep(2000); QThread::msleep(5000);
*/
QProcess process; QProcess process;
QStringList commands; QStringList commands;
commands << "ipsec" << "up" << QString("%1").arg(tunnelName); commands << "ipsec" << "up" << QString("%1").arg(tunnelName);