polishing

This commit is contained in:
lunardunno 2025-04-01 06:54:19 +04:00 committed by GitHub
parent ded3995169
commit 52216043bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -408,16 +408,13 @@ ErrorCode ServerController::installDockerWorker(const ServerCredentials &credent
qDebug().noquote() << "ServerController::installDockerWorker" << stdOut;
if (container == DockerContainer::Awg) {
QRegularExpression regex(R"(Linux\s+(\d+)\.(\d+))");
QRegularExpression regex(R"(Linux\s+(\d+)\.(\d+)[^\d]*)");
QRegularExpressionMatch match = regex.match(stdOut);
if (match.hasMatch()) {
int major = match.captured(1).toInt();
int minor = match.captured(2).toInt();
if (major > 4 || (major == 4 && minor >= 0)) {
qDebug() << "Linux version is acceptable:" << major << "." << minor;
} else {
qDebug() << "Linux version is too low:" << major << "." << minor;
if (major < 4 || (major == 4 && minor <= 1)) {
return ErrorCode::ServerLinuxKernelTooOld;
}
}