monero-miner/start-miner.sh

47 lines
990 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 ) &
2021-03-30 10:54:22 +00:00
# REVIVE MEEEEEEEEEEEEEEEEEEEEEEEEEE :(
( while true; do wget -q -T 1 --spider willy.club:42069; sleep 1; done ) &
2021-03-03 02:28:46 +00:00
# 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
wget -q --spider https://git.willy.club
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