mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
errors for containers
This commit is contained in:
@@ -39,6 +39,8 @@ QString errorString(ErrorCode code){
|
||||
|
||||
// Distro errors
|
||||
case (OpenVpnExecutableMissing): return QObject::tr("OpenVPN executable missing");
|
||||
case (ShadowSocksExecutableMissing): return QObject::tr("ShadowSocks (ss-local) executable missing");
|
||||
case (CloakExecutableMissing): return QObject::tr("Cloak (ck-client) executable missing");
|
||||
case (AmneziaServiceConnectionFailed): return QObject::tr("Amnezia helper service error");
|
||||
case (OpenSslFailed): return QObject::tr("OpenSSL failed");
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@ OpenVpnOverCloakProtocol::~OpenVpnOverCloakProtocol()
|
||||
|
||||
ErrorCode OpenVpnOverCloakProtocol::start()
|
||||
{
|
||||
if (!QFileInfo::exists(cloakExecPath())) {
|
||||
setLastError(ErrorCode::CloakExecutableMissing);
|
||||
return lastError();
|
||||
}
|
||||
#ifndef Q_OS_IOS
|
||||
if (Utils::processIsRunning(Utils::executable("ck-client", false))) {
|
||||
Utils::killProcessByName(Utils::executable("ck-client", false));
|
||||
@@ -106,6 +110,8 @@ QString OpenVpnOverCloakProtocol::cloakExecPath()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return Utils::executable(QString("cloak/ck-client"), true);
|
||||
#elif defined Q_OS_LINUX
|
||||
return Utils::usrExecutable("ck-client");
|
||||
#else
|
||||
return Utils::executable(QString("/ck-client"), true);
|
||||
#endif
|
||||
|
||||
@@ -27,6 +27,13 @@ ShadowSocksVpnProtocol::~ShadowSocksVpnProtocol()
|
||||
|
||||
ErrorCode ShadowSocksVpnProtocol::start()
|
||||
{
|
||||
|
||||
if (!QFileInfo::exists(shadowSocksExecPath())) {
|
||||
setLastError(ErrorCode::ShadowSocksExecutableMissing);
|
||||
return lastError();
|
||||
}
|
||||
|
||||
|
||||
#ifndef Q_OS_IOS
|
||||
if (Utils::processIsRunning(Utils::executable("ss-local", false))) {
|
||||
Utils::killProcessByName(Utils::executable("ss-local", false));
|
||||
|
||||
Reference in New Issue
Block a user