parent
cdf46c968a
commit
fd98ef1250
11 changed files with 475 additions and 276 deletions
|
@ -225,6 +225,24 @@ ErrorCode ServerController::uploadFileToHost(const ServerCredentials &credential
|
|||
return ErrorCode::NoError;
|
||||
}
|
||||
|
||||
ErrorCode ServerController::rebootServer(const ServerCredentials &credentials)
|
||||
{
|
||||
QString script = QString("sudo reboot");
|
||||
|
||||
QString stdOut;
|
||||
auto cbReadStdOut = [&](const QString &data, libssh::Client &) {
|
||||
stdOut += data;
|
||||
return ErrorCode::NoError;
|
||||
};
|
||||
|
||||
auto cbReadStdErr = [&](const QString &data, libssh::Client &) {
|
||||
stdOut += data + "\n";
|
||||
return ErrorCode::NoError;
|
||||
};
|
||||
|
||||
return runScript(credentials, script, cbReadStdOut, cbReadStdErr);
|
||||
}
|
||||
|
||||
ErrorCode ServerController::removeAllContainers(const ServerCredentials &credentials)
|
||||
{
|
||||
return runScript(credentials, amnezia::scriptData(SharedScriptType::remove_all_containers));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue