#!/usr/bin/env bash


## 根据不同版本
release=$(lsb_release -r | awk '{print $NF}')
case "$release" in
    22.04)
        cd /os/miners/custom/ccminer/22.04
        export LD_LIBRARY_PATH=/os/miners/custom/ccminer/22.04:$LD_LIBRARY_PATH
        ;;
    24.04)
        cd /os/miners/custom/ccminer/24.04
        export LD_LIBRARY_PATH=/os/miners/custom/ccminer/24.04:$LD_LIBRARY_PATH
        ;;
    *)
        cd /os/miners/custom/ccminer/20.04
        export LD_LIBRARY_PATH=/os/miners/custom/ccminer/24.04:$LD_LIBRARY_PATH
        ;;
esac

## 调试日志
echo "release = ${release}"
echo "LD_LIBRARY_PATH = ${LD_LIBRARY_PATH}"


## 启动
./ccminer \
-a x16rs \
-o ${CUSTOM_URL} \
-u ${CUSTOM_TEMPLATE} \
-p x \
--api-bind=4069 \
--api-allow=0/0

