Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.38 KB | None | 0 0
  1. #!/bin/bash
  2. echo "########### The server will reboot when the script is complete"
  3. echo "########### Changing to home dir"
  4. cd ~
  5. echo "########### Firewall rules; allow 22,8333"
  6. ufw allow 22/tcp
  7. ufw allow 8333/tcp
  8. ufw --force enable
  9. echo "########### Updating Ubuntu"
  10. apt-get update -y
  11. apt-get upgrade -y
  12. apt-get dist-upgrade -y
  13. apt-get install software-properties-common python-software-properties -y
  14. echo "########### Creating Swap"
  15. dd if=/dev/zero of=/swapfile bs=1M count=1024 ; mkswap /swapfile ; swapon /swapfile
  16. echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
  17. echo "########### Adding ppa:bitcoin/bitcoin and installing bitcoind"
  18. add-apt-repository -y ppa:bitcoin/bitcoin
  19. apt-get update -y
  20. mkdir ~/.bitcoin/
  21. apt-get install bitcoind -y
  22. echo "########### Creating config"
  23. config=".bitcoin/bitcoin.conf"
  24. touch $config
  25. echo "server=1" > $config
  26. echo "daemon=1" >> $config
  27. echo "connections=40" >> $config
  28. echo "prune=20000" >> $config
  29. randUser=`< /dev/urandom tr -dc A-Za-z0-9 | head -c30`
  30. randPass=`< /dev/urandom tr -dc A-Za-z0-9 | head -c30`
  31. echo "rpcuser=$randUser" >> $config
  32. echo "rpcpassword=$randPass" >> $config
  33. echo "########### Setting up autostart (cron)"
  34. crontab -l > tempcron
  35. echo "@reboot bitcoind -daemon" >> tempcron
  36. crontab tempcron
  37. rm tempcron
  38. echo "########### Adding usage tools iftop and htop"
  39. apt-get install iftop
  40. apt-get install htop
  41. reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement