From Sweet Shama, 10 Years ago, written in Plain Text.
Embed
  1. #!/bin/bash
  2. declare -A coins
  3. touch /root/errors
  4. touch /root/report.csv
  5. report=/root/report.csv
  6. port=30004
  7.  
  8. coins["i0coin"]=https://github.com/kR105/i0coin.git
  9. coins["catcoin"]=https://github.com/kR105/catcoin.git
  10. coins["asiccoin"]=https://github.com/asiccoin/asiccoin.git
  11. coins["digibyte"]=https://github.com/digibyte/DigiByteProject.git
  12. coins["datacoin"]=https://github.com/foo1inge/datacoin.git
  13. coins["qubitcoin"]=https://github.com/qubitcoin/QubitCoin.git
  14. coins["franko"]=https://github.com/franko-org/franko.git
  15. coins["velocitycoin"]=https://github.com/Velocitycoin/Velocitycoin.git
  16. coins["junkcoin"]=https://github.com/GIFcoin/JunkCoin.git
  17. coins["potcoin"]=https://github.com/potcoin/potcoin.git
  18.  
  19. for key in ${!coins[@]}; do
  20.  
  21.     useradd -m ${key}
  22.     git clone ${coins[${key}]} /home/${key}/source &
  23.     PID=$!
  24.     while [[ ( -d /proc/$PID ) && ( -z `grep zombie /proc/$PID/status` ) ]]; do
  25.     sleep 1
  26.     done
  27.     cd /home/${key}/source/src
  28.     if [ ! -d "obj" ]; then
  29.     mkdir obj
  30.     fi
  31.     make -f makefile.unix USE_UPNP= &
  32.     PID=$!
  33.     while [[ ( -d /proc/$PID ) && ( -z `grep zombie /proc/$PID/status` ) ]]; do
  34.     sleep 1
  35.     done
  36.     if [ ! -d /home/${key}/${key}d/bin ]; then
  37.  
  38.         mkdir -p /home/${key}/${key}d/bin
  39.  
  40.     fi
  41.     if [ ! -d /home/${key}/.${key} ]; then
  42.  
  43.        mkdir /home/${key}/.${key}
  44.  
  45.     fi
  46.     config=/home/${key}/.${key}/${key}.conf
  47.     touch $config
  48.     rpcuser=${key}rpc
  49.     rpcport=$port
  50.     rpcpass=$(< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c${1:-44})
  51.     port=`expr $port + 1`
  52.     echo "rpcuser=$rpcuser" >> $config
  53.     echo "rpcpasword=$rpcpass" >> $config
  54.     echo "rpcport=$rpcport" >> $config
  55.     echo "gen=0" >> $config
  56.     echo "${key}, $rpcport, $rpcuser, $rpcpass" >> $report
  57.     chown -R ${key}:${key} /home/${key}
  58.     if [ -f /home/${key}/source/src/${key}d ];
  59.     then
  60.         cp /home/${key}/source/src/${key}d /home/${key}/${key}d/bin
  61.     else
  62.         echo "${key}\r\n" >> "/root/errors"
  63.     fi
  64. done
  65.