fix: linux external tun

This commit is contained in:
armv9
2024-07-03 16:55:16 +09:00
parent cd9bb8f72d
commit 7c783308a7
4 changed files with 6 additions and 29 deletions

View File

@@ -1776,9 +1776,8 @@ bool MainWindow::StartVPNProcess() {
return true;
}
//
auto protectPath = QDir::currentPath() + "/protect";
auto configPath = NekoGui::WriteVPNSingBoxConfig();
auto scriptPath = NekoGui::WriteVPNLinuxScript(protectPath, configPath);
auto scriptPath = NekoGui::WriteVPNLinuxScript(configPath);
//
#ifdef Q_OS_WIN
runOnNewThread([=] {
@@ -1790,11 +1789,6 @@ bool MainWindow::StartVPNProcess() {
runOnUiThread([=] { neko_set_spmode_vpn(false); });
});
#else
QFile::remove(protectPath);
if (QFile::exists(protectPath)) {
MessageBoxWarning("Error", "protect cannot be removed");
return false;
}
//
auto vpn_process = new QProcess;
QProcess::connect(vpn_process, &QProcess::stateChanged, this, [=](QProcess::ProcessState state) {