Skip to content

Commit

Permalink
ethminer-0.15.0.dev1
Browse files Browse the repository at this point in the history
  • Loading branch information
Pasha49 committed Apr 13, 2018
1 parent 4d25701 commit 73fc44b
Showing 5 changed files with 38 additions and 10 deletions.
46 changes: 37 additions & 9 deletions hive/bin/ethminer
Original file line number Diff line number Diff line change
@@ -27,18 +27,46 @@ function config_gen() {
[[ -z $ETHMINER_OPENCL && $ETHMINER_CUDA == 1 ]] && echo "--cuda" >> $MINER_CONFIG
[[ $ETHMINER_OPENCL == 1 && $ETHMINER_CUDA == 1 ]] && echo "--cuda-opencl" >> $MINER_CONFIG

if [[ ! -z $ETHMINER_TEMPLATE ]]; then
echo -n "-O $ETHMINER_TEMPLATE" >> $MINER_CONFIG
[[ ! -z $ETHMINER_PASS ]] && echo -n ":$ETHMINER_PASS" >> $MINER_CONFIG
echo -en "\n" >> $MINER_CONFIG
fi

if [[ ! -z $ETHMINER_SERVER ]]; then
echo -n "-S $ETHMINER_SERVER" >> $MINER_CONFIG
[[ ! -z $ETHMINER_PORT ]] && echo -n ":$ETHMINER_PORT" >> $MINER_CONFIG
echo -en "\n" >> $MINER_CONFIG
#pre 0.14.0rc0
# if [[ ! -z $ETHMINER_TEMPLATE ]]; then
# echo -n "-O $ETHMINER_TEMPLATE" >> $MINER_CONFIG
# [[ ! -z $ETHMINER_PASS ]] && echo -n ":$ETHMINER_PASS" >> $MINER_CONFIG
# echo -en "\n" >> $MINER_CONFIG
# fi
#
# if [[ ! -z $ETHMINER_SERVER ]]; then
# echo -n "-S $ETHMINER_SERVER" >> $MINER_CONFIG
# [[ ! -z $ETHMINER_PORT ]] && echo -n ":$ETHMINER_PORT" >> $MINER_CONFIG
# echo -en "\n" >> $MINER_CONFIG
# fi


if [[ ! -z $ETHMINER_TEMPLATE && ! -z $ETHMINER_SERVER ]]; then
local url=
local protocol=
local server=
grep -q "^stratum.*://" <<< $ETHMINER_SERVER
if [[ $? == 0 ]]; then
protocol=`awk -F '://' '{print $1"://"}' <<< $ETHMINER_SERVER`
server=`awk -F '://' '{print $2}' <<< $ETHMINER_SERVER`
else #no protocol in server
protocol="stratum+tcp://"
server=$ETHMINER_SERVER
fi
url+=$protocol

url+=$ETHMINER_TEMPLATE
[[ ! -z $ETHMINER_PASS ]] && url+=":$ETHMINER_PASS"

url+="@$server:$ETHMINER_PORT"

echo "-P $url" >> $MINER_CONFIG
fi




[[ ! -z $ETHMINER_USER_CONFIG ]] && echo "$ETHMINER_USER_CONFIG" >> $MINER_CONFIG

#replace tpl values in whole file
2 changes: 1 addition & 1 deletion hive/ethminer
Binary file not shown.
File renamed without changes.
File renamed without changes.

0 comments on commit 73fc44b

Please sign in to comment.