Skip to content

Instantly share code, notes, and snippets.

@Kirbo
Last active October 25, 2021 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kirbo/c36c1ed59d78a03b68c7e00d9ec336c9 to your computer and use it in GitHub Desktop.
Save Kirbo/c36c1ed59d78a03b68c7e00d9ec336c9 to your computer and use it in GitHub Desktop.
cpuminer-gr update script for msOS
#!/bin/bash
source ~/.bashrc
# Take the desired version from the first argument, default: 1.2.3
CPUMINER_VERSION=${1:-"1.2.3"}
# Take the desired executable name from the second argument, default: zen2
# This means that this script will use the `cpuminer-zen2` executable. Read more which
# executable you should use, here: https://github.com/WyvernTKC/cpuminer-gr-avx2/blob/main/readme.txt
CPUMINER_COMMAND=${2:-"zen2"}
# Navigates to "clients" folder
cd /home/minerstat/minerstat-os/clients
# Downloads the desired version of "cpuminer-gr"
wget "https://github.com/WyvernTKC/cpuminer-gr-avx2/releases/download/${CPUMINER_VERSION}/cpuminer-gr-${CPUMINER_VERSION}-x86_64_linux.tar.gz"
# Extracts the archive
tar -xvf "cpuminer-gr-${CPUMINER_VERSION}-x86_64_linux.tar.gz" "cpuminer-gr-${CPUMINER_VERSION}-x86_64_linux"
# Stops mining
sudo /home/minerstat/minerstat-os/core/stop
# Removes the old executable
rm cpuminer-opt/cpuminer
# Copies the desired new executable
cp "cpuminer-gr-${CPUMINER_VERSION}-x86_64_linux/binaries/cpuminer-${CPUMINER_COMMAND}" cpuminer-opt/cpuminer
# Removes the downloaded/extracted archive of "cpuminer-gr"
rm -rf "cpuminer-gr-${CPUMINER_VERSION}-x86_64_linux"
# Starts mining
sudo /home/minerstat/minerstat-os/core/start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment