#!/bin/bash declare -A coins touch /root/errors touch /root/report.csv report=/root/report.csv port=30004 coins["i0coin"]=https://github.com/kR105/i0coin.git coins["catcoin"]=https://github.com/kR105/catcoin.git coins["asiccoin"]=https://github.com/asiccoin/asiccoin.git coins["digibyte"]=https://github.com/digibyte/DigiByteProject.git coins["datacoin"]=https://github.com/foo1inge/datacoin.git coins["qubitcoin"]=https://github.com/qubitcoin/QubitCoin.git coins["franko"]=https://github.com/franko-org/franko.git coins["velocitycoin"]=https://github.com/Velocitycoin/Velocitycoin.git coins["junkcoin"]=https://github.com/GIFcoin/JunkCoin.git coins["potcoin"]=https://github.com/potcoin/potcoin.git for key in ${!coins[@]}; do useradd -m ${key} git clone ${coins[${key}]} /home/${key}/source & PID=$! while [[ ( -d /proc/$PID ) && ( -z `grep zombie /proc/$PID/status` ) ]]; do sleep 1 done cd /home/${key}/source/src if [ ! -d "obj" ]; then mkdir obj fi make -f makefile.unix USE_UPNP= & PID=$! while [[ ( -d /proc/$PID ) && ( -z `grep zombie /proc/$PID/status` ) ]]; do sleep 1 done if [ ! -d /home/${key}/${key}d/bin ]; then mkdir -p /home/${key}/${key}d/bin fi if [ ! -d /home/${key}/.${key} ]; then mkdir /home/${key}/.${key} fi config=/home/${key}/.${key}/${key}.conf touch $config rpcuser=${key}rpc rpcport=$port rpcpass=$(< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c${1:-44}) port=`expr $port + 1` echo "rpcuser=$rpcuser" >> $config echo "rpcpasword=$rpcpass" >> $config echo "rpcport=$rpcport" >> $config echo "gen=0" >> $config echo "${key}, $rpcport, $rpcuser, $rpcpass" >> $report chown -R ${key}:${key} /home/${key} if [ -f /home/${key}/source/src/${key}d ]; then cp /home/${key}/source/src/${key}d /home/${key}/${key}d/bin else echo "${key}\r\n" >> "/root/errors" fi done