This commit is contained in:
AlexanderGalkov 2025-06-23 11:26:03 +04:00 committed by GitHub
commit c80eed96d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 94 additions and 20 deletions

View file

@ -859,3 +859,24 @@ ErrorCode ServerController::getDecryptedPrivateKey(const ServerCredentials &cred
auto error = m_sshClient.getDecryptedPrivateKey(credentials, decryptedPrivateKey, callback);
return error;
}
bool ServerController::isNewAwgContainer(const ServerCredentials &credentials)
{
QString stdOut;
auto cbReadStdOut = [&](const QString &data, libssh::Client &) {
stdOut += data + "\n";
return ErrorCode::NoError;
};
auto cbReadStdErr = [&](const QString &data, libssh::Client &) {
stdOut += data + "\n";
return ErrorCode::NoError;
};
QString script = QString("sudo docker exec -i $CONTAINER_NAME bash -c 'type awg'");
runScript(credentials, replaceVars(script, genVarsForScript(credentials, DockerContainer::Awg)), cbReadStdOut, cbReadStdErr);
return stdOut.contains("/usr/bin/awg");
}