HiveOS support

This commit is contained in:
Haifa Bogdan Adnan 2019-08-28 00:56:55 +03:00
parent 2a62844fe8
commit 370cf7487b
5 changed files with 147 additions and 0 deletions

17
hiveos/h-config.sh Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
. $MINER_DIR/$CUSTOM_MINER/h-manifest.conf
[[ -z $CUSTOM_TEMPLATE ]] && echo -e "${YELLOW}CUSTOM_TEMPLATE is empty${NOCOLOR}" && return 1
[[ -z $CUSTOM_URL ]] && echo -e "${YELLOW}CUSTOM_URL is empty${NOCOLOR}" && return 1
conf="-o ${CUSTOM_URL} -u ${CUSTOM_TEMPLATE} -p $WORKER_NAME --api-port ${CUSTOM_API_PORT} ${CUSTOM_USER_CONFIG}"
#replace tpl values in whole file
[[ ! -z $EWAL ]] && conf=$(sed "s/%EWAL%/$EWAL/g" <<< "$conf")
[[ ! -z $DWAL ]] && conf=$(sed "s/%DWAL%/$DWAL/g" <<< "$conf")
[[ ! -z $ZWAL ]] && conf=$(sed "s/%ZWAL%/$ZWAL/g" <<< "$conf")
[[ ! -z $EMAIL ]] && conf=$(sed "s/%EMAIL%/$EMAIL/g" <<< "$conf")
[[ ! -z $WORKER_NAME ]] && conf=$(sed "s/%WORKER_NAME%/$WORKER_NAME/g" <<< "$conf")
echo "$conf" > $MINER_DIR/$CUSTOM_MINER/$CUSTOM_NAME.conf