Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # This script checks if xmrig is running, logs the status, and if found not to be running,
- # opens a detached screen window and execute a second script which contains the xmrig command line.
- #
- # @latrinelove
- bindir=/opt/xmrig
- if pgrep -x "xmrig" > /dev/null
- then
- echo "[$(date "+%d.%m.%Y - %H.%M.%S")] xmrig is running" >> $bindir/status.log
- else
- echo "[$(date "+%d.%m.%Y - %H.%M.%S")] xmrig is not running" >> $bindir/status.log
- fi
- if ! pgrep -x "xmrig" > /dev/null
- then
- screen -dmS mining-restart /opt/loki-cline.sh && \
- echo "[$(date "+%d.%m.%Y - %H.%M.%S")] xmrig has been restarted" >> $bindir/status.log
- fi
Add Comment
Please, Sign In to add comment