Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.35 KB | None | 0 0
  1.  
  2. #!/bin/bash
  3.  
  4. if [[ $USER != "root" ]]; then
  5.     echo "Maaf, Anda harus menjalankan ini sebagai root"
  6.     exit
  7. fi
  8.  
  9. if [[ -e ~/xmr-stak-cpu ]]; then
  10. read -p "Sepertinya xmr-stak-cpu telah terpasang, apakah anda ingin menghapusnya?[y/n] " -e -i n already
  11.     if [ "$already" = "y" ]; then
  12. rm -rf ~/xmr-stak-cpu
  13.     fi
  14. exit
  15. fi
  16.  
  17. echo "======== Auto install xmr-stak-cpu for ubuntu 16.04 ========="
  18. echo ""
  19. echo "Harap diperhatikan saat mengisi informasi yang dibutuhkan karena proses 1x"
  20. echo "jika terjadi kesalahan silakan jalankan ulang file ini untuk menghapus kemuadian mulai dari awal"
  21. echo ""
  22. read -p monero -e currency
  23. read -p pool.supportxmr.com:3333 -e pooladdress
  24. read -p 4Hm3YrYNgczRAP7jbGCZ7vA8XwbBR8DWMU7Bm9FKZqjxQXPPcwMP1kDbK3mtBSdt2c6TmLCPiMSXa39uBiEBwkg4FWWwxXwtDAE4W4fjoy -e wallet
  25. read -p "Masukan static diff jika ada jika tidak langsung enter(Example: 3000): " -e diff
  26. read -p "Masukan pool password (biasanya x atau kosong): "x -e -i x poolpass
  27. echo ""
  28. echo "Installing ..."
  29. sleep 2
  30. clear
  31. #update repositori
  32. apt-get --assume-yes update
  33.  
  34. #install package yang dibutuhkan
  35. apt-get --assume-yes install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev screen git nano cpulimit
  36.  
  37. #setup xmr-stak-cpu mining
  38. git clone https://github.com/fireice-uk/xmr-stak-cpu.git
  39. cd xmr-stak-cpu
  40. cmake .
  41. sleep 1
  42. make install
  43. cd bin/
  44. chmod +x xmr-stak-cpu
  45. sysctl -w vm.nr_hugepages=128
  46.  
  47.  
  48. sed -i -e 's/"pool_address" : "pool.usxmrpool.com:3333",/"pool_address" : "'"$pooladdress"'",/g' config.txt
  49.  
  50. if [ $diff ]; then
  51.  
  52. sed -i -e 's/"wallet_address" : "",/"wallet_address" : "'"$wallet"."$diff"'",/g' config.txt
  53.  
  54. else
  55. sed -i -e 's/"wallet_address" : "",/"wallet_address" : "'"$wallet"'",/g' config.txt
  56. fi
  57.  
  58. sed -i -e 's/"pool_password" : "",/"pool_password" : "'"$poolpass"'",/g' config.txt
  59.  
  60. sleep 1
  61. clear
  62. echo "tahap installasi selesai, beberapa pertanyaan terakhir"
  63. echo ""
  64. echo "beberapa provider terkadang suspend vps jadi misal core vps ada 6 silakan input 4 (just saran)"
  65. echo ""
  66. read -p "Masukan core vps (1-6): " -e corevps
  67. read -p "Apakah anda ingin langsung menjalankan mining? [y/n]: " -e -i n mining
  68.  
  69. if [[ "$corevps" = '1' ]]; then
  70. sed -i 's/null,/[ \n { "low_power_mode" : true, "no_prefetch" : true, "affine_to_cpu" : 0 }, \n ],/g' config.txt
  71. fi
  72.  
  73. if [[ "$corevps" = '6' ]]; then
  74. sed -i 's/null,/[ \n { "low_power_mode" : true, "no_prefetch" : true, "affine_to_cpu" : 0 }, \n { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 1 }, \n { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 2 }, \n { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 3 }, \n { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 4 }, \n { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 5 }, \n ],/g' config.txt
  75. fi
  76.  
  77. if [[ "$mining" = 'y' ]]; then
  78. cd ~/xmr-stak-cpu/bin
  79. screen -dmS mining ./xmr-stak-cpu
  80. clear
  81. echo "script mining telah dijalankan"
  82. echo ""
  83. echo "untuk melihat cpu usage gunakan perintah top"
  84. echo "untuk melihat aktifitas mining dan  hashrate gunakan perintah screen -r kemudian tekan h"
  85. echo "untuk menutup ctrl+a+d agar tetap jalan miningnya ^_^"
  86. echo ""
  87. echo "siap grak terima gaji ^_^"
  88.  
  89. else
  90. clear
  91. echo "script berhasil terinstall untuk menjalankan gunakan perintah screen kemudian ./xmr-stak-cpu"
  92. echo ""
  93. echo "siap grak terima gaji ^_^"
  94. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement