#!/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
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}