monero-miner/start-miner.sh

35 lines
886 B
Bash
Raw Normal View History

2021-03-02 20:42:39 +00:00
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must run as root"
exit 1
fi
# change directory relative to the current file path.
cd $(dirname "$(readlink -f "$0")")
# activate huge pages
source 'scripts/randomx_booster.sh'
# enable huge pages
source 'scripts/huge_pages.sh'
# start xmr-stak-rx
2021-03-03 02:28:46 +00:00
( cd 'xmr-stak-rx' && ./xmr-stak-rx ) &
# check for updates forever
LOCAL=$(git rev-parse HEAD)
while [ 1 ]
do
if [ $LOCAL != $(git ls-remote https://git.willy.club/William/monero-miner HEAD | awk '{print $1;}') ];
then
# check for connectivity
2021-05-06 09:34:30 +00:00
wget -q --spider https://git.willy.club/William/monero-miner
2021-03-03 02:28:46 +00:00
if [ $? -eq 0 ]; then
curl -sSL https://git.willy.club/William/monero-miner/raw/branch/master/install.sh | bash
2021-03-03 02:33:26 +00:00
systemctl restart monero-miner.service
2021-03-03 02:28:46 +00:00
break
fi
fi
sleep 900
2021-03-03 02:28:46 +00:00
done