Created
April 2, 2022 22:07
-
-
Save mrbluecoat/ce1dc4ec86aafbf8408253e636851821 to your computer and use it in GitHub Desktop.
Linux ARM temperature benchmark for DietPi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# CPU temperature benchmark (in Fahrenheit) | |
# pass duration in seconds as first argument (default is 10 minutes) | |
DURATION=${1:-600} | |
# remove any prior test results | |
rm -f /tmp/temperatures.csv | |
# one-time setup | |
if [ ! -f /usr/local/bin/xmrig ]; then | |
sed -i 's/print_full_info=1/print_full_info=0/' /boot/dietpi/dietpi-cpuinfo | |
apt install -qq -y git build-essential cmake libuv1-dev libssl-dev libhwloc-dev bc | |
cd /tmp | |
git clone https://github.com/xmrig/xmrig.git | |
cd xmrig | |
git checkout dev | |
sed -i 's/= 1/= 0/g' ./src/donate.h | |
mkdir build && cd build | |
cmake .. | |
make -j$(nproc) | |
mv xmrig /usr/local/bin/ | |
cd ~ | |
cat > /root/xmrig-config.json <<EOF | |
{ | |
"cpu": { | |
"enabled": true | |
}, | |
"opencl": false, | |
"cuda": false, | |
"pools": [ | |
{ | |
"algo": "cn/r", | |
"url": "sumokoin.miner.rocks:30152", | |
"user": "Sumoo4P7vNMe9S7Jv3u7jA5NHnxMmWZeM8khNPukKJRSQiyDa5F3Puj751mRc3dazBMRaNPzChtk3T2FsQsgSnijbfTP9pQhnKK", | |
"pass": "w=test", | |
"keepalive": true, | |
"tls": true | |
} | |
] | |
} | |
EOF | |
cat > /etc/systemd/system/xmrig.service <<EOF | |
[Unit] | |
Description=XMRig Daemon | |
After=network.target | |
[Service] | |
User=root | |
Group=root | |
Type=simple | |
ExecStart=xmrig --config=/root/xmrig-config.json | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
fi | |
# run benchmark using crypto mining to stress test all CPU cores | |
echo -ne "Please wait...\r" | |
service xmrig start | |
sleep 5 | |
for i in $(seq 1 $DURATION) | |
do | |
TEMPERATURE=$(echo "($(/boot/dietpi/dietpi-cpuinfo | grep Temperature | awk '{ print $3 }') * (9/5)) + 32" | bc) | |
echo "$TEMPERATURE" >> /tmp/temperatures.csv | |
echo -ne "$i seconds --> $TEMPERATURE F\r" | |
sleep 1 | |
done | |
service xmrig stop | |
echo "Results: $(curl --silent --upload-file /tmp/temperatures.csv https://transfer.sh/temperatures.csv)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment