metalni

server init

Aug 24th, 2020 (edited)
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.34 KB | None | 0 0
  1. // RUN CHMOD+X scriptname.sh before executing
  2.  
  3. #!/bin/bash
  4. echo '==============================================================================';
  5. echo 'Starting Script.....';
  6. echo 'Installing dependendencies, needed software and setting default values.....';
  7. echo '==============================================================================';
  8. cd ~;
  9. apt-get update -y && apt-get upgrade -y;
  10. apt-get install lib32gcc1 -y ;
  11. apt-get install screen -y;
  12. iptables -A INPUT -p udp -m udp --sport 27015:27020 --dport 1025:65355 -j ACCEPT;
  13. iptables -A INPUT -p udp -m udp --sport 4380 --dport 1025:65355 -j ACCEPT;
  14. apt-get install zip -y;
  15. echo '==============================================================================';
  16. echo 'Installing apache2, php, ssh2 and vsftpd';
  17. echo '==============================================================================';
  18. apt-get install apache2 -y;
  19. apt install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https;
  20. wget https://packages.sury.org/php/apt.gpg;
  21. sudo apt-key add apt.gpg;
  22. echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.list
  23. sudo apt update;
  24. sudo apt install -y php7.2 php7.2-cli php7.2-common;
  25. sudo update-alternatives --set php /usr/bin/php7.2;
  26. sudo apt install -y php7.2-ssh2;
  27. sudo apt-get install vsftpd -y;
  28. systemctl start vsftpd;
  29. systemctl enable vsftpd;
  30. rm -rf /etc/adduser.conf && cd /etc && wget 109.230.236.94/adduser.conf;
  31. cd ~;
  32. rm -rf /etc/vsftpd.conf && cd /etc && wget 109.230.236.94/vsftpd.conf;
  33. echo '==============================================================================';
  34. echo 'Configuring cstrike directories and installing data for game servers';
  35. echo '==============================================================================';
  36. cd /home && mkdir cstrike && cd cstrike && mkdir instalacija && mkdir servers;
  37. cd ~;
  38. cd /home/cstrike/instalacija;
  39. wget 95.156.230.138/pub.zip;
  40. wget 95.156.230.138/linked.tar.gz;
  41. unzip pub.zip;
  42. tar -xzf linked.tar.gz;
  43. mkdir backup && mv linked.tar.gz backup && mv pub.zip backup;
  44. echo '==============================================================================';
  45. echo 'The script has finished working, check for bugs.....'
  46. echo 'This script was coded by puNisher.....';
  47. echo '==============================================================================';
  48. exit 0;
Add Comment
Please, Sign In to add comment