mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-12-22 14:49:21 +00:00
fix: xmrig can't be started after proxy
This commit is contained in:
parent
0949458d85
commit
80db6bbacc
2 changed files with 19 additions and 16 deletions
|
@ -59,22 +59,22 @@ const GUPAX_METADATA: &str = "https://api.github.com/repos/Cyrix126/gupaxx/relea
|
|||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(target_family = "unix")] {
|
||||
pub(super) const GUPAX_BINARY: &str = "gupaxx";
|
||||
pub(super) const P2POOL_BINARY: &str = "p2pool";
|
||||
pub(super) const NODE_BINARY: &str = "monerod";
|
||||
pub(super) const XMRIG_BINARY: &str = "xmrig";
|
||||
pub(super) const XMRIG_PROXY_BINARY: &str = "xmrig-proxy";
|
||||
pub const GUPAX_BINARY: &str = "gupaxx";
|
||||
pub const P2POOL_BINARY: &str = "p2pool";
|
||||
pub const NODE_BINARY: &str = "monerod";
|
||||
pub const XMRIG_BINARY: &str = "xmrig";
|
||||
pub const XMRIG_PROXY_BINARY: &str = "xmrig-proxy";
|
||||
}
|
||||
}
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(target_os = "windows")] {
|
||||
pub(super) const OS_TARGET: &str = "windows";
|
||||
pub(super) const ARCHIVE_EXT: &str = "zip";
|
||||
pub(super) const GUPAX_BINARY: &str = "Gupaxx.exe";
|
||||
pub(super) const P2POOL_BINARY: &str = "p2pool.exe";
|
||||
pub(super) const NODE_BINARY: &str = "monerod.exe";
|
||||
pub(super) const XMRIG_BINARY: &str = "xmrig.exe";
|
||||
pub(super) const XMRIG_PROXY_BINARY: &str = "xmrig-proxy.exe";
|
||||
pub const GUPAX_BINARY: &str = "Gupaxx.exe";
|
||||
pub const P2POOL_BINARY: &str = "p2pool.exe";
|
||||
pub const NODE_BINARY: &str = "monerod.exe";
|
||||
pub const XMRIG_BINARY: &str = "xmrig.exe";
|
||||
pub const XMRIG_PROXY_BINARY: &str = "xmrig-proxy.exe";
|
||||
} else if #[cfg(target_os = "linux")] {
|
||||
pub(super) const OS_TARGET: &str = "linux";
|
||||
pub(super) const ARCHIVE_EXT: &str = "tar.gz";
|
||||
|
|
|
@ -2,7 +2,10 @@ use std::sync::{Arc, Mutex};
|
|||
|
||||
use sysinfo::System;
|
||||
|
||||
use crate::helper::ProcessName;
|
||||
use crate::{
|
||||
components::update::{NODE_BINARY, P2POOL_BINARY, XMRIG_BINARY, XMRIG_PROXY_BINARY},
|
||||
helper::ProcessName,
|
||||
};
|
||||
|
||||
use super::sudo::SudoState;
|
||||
|
||||
|
@ -98,14 +101,14 @@ impl ErrorState {
|
|||
|
||||
pub fn process_running(process_name: ProcessName) -> bool {
|
||||
let name = match process_name {
|
||||
ProcessName::Node => "monerod",
|
||||
ProcessName::P2pool => "p2pool",
|
||||
ProcessName::Xmrig => "xmrig",
|
||||
ProcessName::XmrigProxy => "xmrig-proxy",
|
||||
ProcessName::Node => NODE_BINARY,
|
||||
ProcessName::P2pool => P2POOL_BINARY,
|
||||
ProcessName::Xmrig => XMRIG_BINARY,
|
||||
ProcessName::XmrigProxy => XMRIG_PROXY_BINARY,
|
||||
ProcessName::Xvb => panic!("XvB does not exist as a process outside of Gupaxx"),
|
||||
};
|
||||
let s = System::new_all();
|
||||
if s.processes_by_name(name.as_ref()).next().is_some() {
|
||||
if s.processes_by_exact_name(name.as_ref()).next().is_some() {
|
||||
return true;
|
||||
}
|
||||
false
|
||||
|
|
Loading…
Reference in a new issue