Skip to content

Instantly share code, notes, and snippets.

@thachp
Created June 3, 2018 22:44
Show Gist options
  • Save thachp/f7137dc02d3dd28eb65bcab6333e6ccb to your computer and use it in GitHub Desktop.
Save thachp/f7137dc02d3dd28eb65bcab6333e6ccb to your computer and use it in GitHub Desktop.
#!/bin/bash
osSeries=none
# OS Series
MODULE_FGLRX=`dpkg -l | grep fglrx | wc -l`
if [ $MODULE_FGLRX -gt 0 ]; then
osSeries=R
fi
MODULE_AMDGPU=`lsmod | grep amdgpu | wc -l`
if [ $MODULE_AMDGPU -gt 0 ]; then
osSeries=RX
fi
MODULE_NVIDIA=`lsmod | grep nvidia | wc -l`
if [ $MODULE_NVIDIA -gt 0 ]; then
osSeries=NV
fi
osVersion=1175
BASEURL="https://simplemining.net"
REPO_MINERS="http://download.simplemining.net/miners"
statusDmesg=""
statusLspci=""
RIG_SERIAL_MBO=`sudo dmidecode --string baseboard-serial-number | sed 's/.*ID://;s/ //g' | tr '[:upper:]' '[:lower:]'`
RIG_SERIAL_MAC=`sudo ifconfig | grep eth0 | awk '{print $NF}' | sed 's/://g' | tr '[:upper:]' '[:lower:]'`
RIG_PRIVATE_KEY="$RIG_SERIAL_MBO$RIG_SERIAL_MAC"
RIG_PUBLIC_KEY=`echo $RIG_PRIVATE_KEY | sha256sum | awk '{print $1}'`
## USER file config
USER_EMAIL=`cat /mnt/user/config.txt | grep USER_EMAIL | head -n1 | cut -d = -f 2 | cut -d ' ' -f 1 | tr '[:upper:]' '[:lower:]' | tr -d '\r'`
JSON=`cat /home/miner/config.json`
MODULE_FGLRX=`lsmod | grep fglrx | wc -l`
MODULE_AMDGPU=`lsmod | grep amdgpu | wc -l`
MINER_PATH=`echo $JSON | jq -r .minerPath`
MINER_OPTIONS=`echo $JSON | jq -r .minerOptions`
MINER_CORE=`echo $JSON | jq -r .ocCore`
MINER_MEMORY=`echo $JSON | jq -r .ocMemory`
MINER_POWERLIMIT=`echo $JSON | jq -r .ocPowerlimit`
MINER_OCVDDC=`echo $JSON | jq -r .ocVddc`
MINER_DIR=`dirname $MINER_PATH`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment