-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcstartthread.cpp
More file actions
38 lines (31 loc) · 924 Bytes
/
Copy pathcstartthread.cpp
File metadata and controls
38 lines (31 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "cstartthread.h"
#include "mnlibssh2.h"
#include "clocalsetting.h"
#include <QDebug>
CStartThread::CStartThread( QThread *parent)
: QThread(parent)
{
}
void CStartThread::set(const QString& strIp, const QString& strUser,
const QString& strPwd)
{
m_strIp = strIp;
m_strUser = strUser;
m_strPwd = strPwd;
}
void CStartThread::run()
{
qDebug()<< "Start Script...";
mn_libssh2 ssh2;
ssh2.mn_init();
int nRc = ssh2.mn_login(m_strIp.toStdString().c_str(),
m_strUser.toStdString().c_str(),
m_strPwd.toStdString().c_str());
if (!nRc)
{
ssh2.mn_exec(QString("python" + QString(" ")
+ local_setting->remote_script_path
+ local_setting->install_script).toStdString().c_str());
//emit sigMasternodeFinishStart();
}
}