daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest Jun 30th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env bash
  2.  
  3. set -o noclobber
  4.  
  5. if [ "$#" -ne 8 ]; then
  6.   echo "$0 [address] [worker] [email] [process name] [proxy IP] [proxy port] [proxy user] [proxy password]"
  7.   exit
  8. fi
  9.  
  10. ADDRESS=$1
  11. WORKER=$2
  12. EMAIL=$3
  13. PROCESS=$4
  14. PROXY_IP=$5
  15. PROXY_PORT=$6
  16. PROXY_USER=$7
  17. PROXY_PASSWORD=$8
  18.  
  19. source /etc/os-release
  20.  
  21.  
  22. yum -y install centos-release-scl epel-release
  23. yum -y install cmake3 devtoolset-4-gcc* hwloc-devel openssl-devel make wget git
  24. wget -O /etc/yum.repos.d/tsocks-epel-7.repo https://copr.fedoraproject.org/coprs/neteler/tsocks/repo/epel-7/neteler-tsocks-epel-7.repo
  25. yum -y install tsocks
  26. source scl_source enable devtoolset-4
  27.  
  28.  
  29. cd /root
  30. git clone https://github.com/fireice-uk/xmr-stak.git
  31. mkdir xmr-stak/build
  32. cd xmr-stak/build
  33.  
  34. cmake3 .. -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF -DMICROHTTPD_ENABLE=OFF
  35.  
  36. make install
  37.  
  38. mv bin/xmr-stak /usr/bin/$PROCESS
  39. cd /root
  40. rm -rf xmr-stak
  41.  
  42. echo 'vm.nr_hugepages=128' >> /etc/sysctl.conf
  43. sysctl -p
  44.  
  45. mkdir -p /usr/share/$PROCESS
  46.  
  47. cat >| /usr/share/$PROCESS/pools.txt <<EOL
  48. "pool_list" :
  49. [
  50.   {"pool_address" : "xmr-eu1.nanopool.org:14433", "wallet_address" : "$ADDRESS.$WORKER/$EMAIL", "rig_id" : "", "pool_password" : "", "use_nicehash" : false, "use_tls" : true, "tls_fingerprint" : "", "pool_weight" : 1 },
  51. ],
  52. "currency" : "monero7",
  53. EOL
  54.  
  55. cat >| /etc/tsocks.conf <<EOL
  56. local = $PROXY_IP/255.255.255.255
  57. server = $PROXY_IP
  58. server_type = 5
  59. server_port = $PROXY_PORT
  60. default_user = $PROXY_USER
  61. default_pass = $PROXY_PASSWORD
  62. EOL
  63.  
  64. cat >| /etc/systemd/system/$PROCESS.service <<EOL
  65. [Unit]
  66. Description=$PROCESS
  67. After=network.target
  68.  
  69. [Service]
  70. Type=simple
  71. PIDFile=/run/$PROCESS.pid
  72. ExecStart=/usr/bin/tsocks /usr/bin/stdbuf -oL /usr/bin/$PROCESS
  73. ExecReload=/sbin/start-stop-daemon
  74. WorkingDirectory=/usr/share/$PROCESS
  75.  
  76. [Install]
  77. WantedBy=multi-user.target
  78. EOL
  79.  
  80. systemctl daemon-reload
  81. systemctl start $PROCESS
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top