Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- set -o noclobber
- if [ "$#" -ne 8 ]; then
- echo "$0 [address] [worker] [email] [process name] [proxy IP] [proxy port] [proxy user] [proxy password]"
- exit
- fi
- ADDRESS=$1
- WORKER=$2
- EMAIL=$3
- PROCESS=$4
- PROXY_IP=$5
- PROXY_PORT=$6
- PROXY_USER=$7
- PROXY_PASSWORD=$8
- source /etc/os-release
- dnf -y install gcc gcc-c++ hwloc-devel libstdc++-static make openssl-devel cmake tsocks git
- cd /root
- git clone https://github.com/fireice-uk/xmr-stak.git
- mkdir xmr-stak/build
- cd xmr-stak/build
- cmake .. -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF -DMICROHTTPD_ENABLE=OFF
- make install
- mv bin/xmr-stak /usr/bin/$PROCESS
- cd /root
- rm -rf xmr-stak
- echo 'vm.nr_hugepages=128' >> /etc/sysctl.conf
- sysctl -p
- mkdir -p /usr/share/$PROCESS
- cat >| /usr/share/$PROCESS/pools.txt <<EOL
- "pool_list" :
- [
- {"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 },
- ],
- "currency" : "monero7",
- EOL
- cat >| /etc/tsocks.conf <<EOL
- local = $PROXY_IP/255.255.255.255
- server = $PROXY_IP
- server_type = 5
- server_port = $PROXY_PORT
- default_user = $PROXY_USER
- default_pass = $PROXY_PASSWORD
- EOL
- cat >| /etc/systemd/system/$PROCESS.service <<EOL
- [Unit]
- Description=$PROCESS
- After=network.target
- [Service]
- Type=simple
- PIDFile=/run/$PROCESS.pid
- ExecStart=/usr/bin/tsocks /usr/bin/stdbuf -oL /usr/bin/$PROCESS
- ExecReload=/sbin/start-stop-daemon
- WorkingDirectory=/usr/share/$PROCESS
- [Install]
- WantedBy=multi-user.target
- EOL
- systemctl daemon-reload
- systemctl start $PROCESS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement