Advertisement
thevipershowita

install.sh

Oct 23rd, 2019
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.31 KB | None | 0 0
  1. #!/bin/bash
  2. sudo apt install openjdk-8-jre-headless screen ufw curl -y
  3. read -p $'\e[44mChoose this server name\e[0m: ' servername
  4. mkdir -p minecraft/$servername/plugins && cd minecraft/$servername
  5. printf "\e[100m\n-----------------------------------------------------\n|Select Spigot version to be installed. [Stable 1.12.2] |\nWARNING: Version from 1.8-1.10.2 will require API specification:\n example: \n1.8.8-R0.1-SNAPSHOT-latest\n-----------------------------------------------------\n\e[49m"
  6. read -p $'\e[44mVersion\e[0m: ' version
  7. wget https://cdn.getbukkit.org/spigot/spigot-$version.jar
  8. printf "\e[100m\n----------------------------------------------\n| Select the port to be opened for the server . |\n----------------------------------------------\n\e[49m"
  9. read -p $'\e[44mPort\e[0m: ' port
  10. printf "\e[100m\n----------------------------------------------\n| You want server online-mode? [true/false]. |\n----------------------------------------------\n\e[49m"
  11. read -p $'\e[44monline-mode=\e[0m' mode
  12. if [ "$mode" == "false" ]; then
  13.     printf "server-port=$port\nonline-mode=false" >server.properties
  14. else
  15.     printf "SETTING TO DEFAULT.\n"
  16.     printf "server-port=$port" >server.properties
  17. fi
  18. sudo ufw allow $port/tcp && sudo ufw reload
  19. printf "\e[100m\n------------------------------------------------------------\n| How much DRAM will the server be able to use? (In MEGABYTES) |\n------------------------------------------------------------\n\e[49m"
  20. read -p $'\e[44mValue\e[0m: ' id
  21. printf "java -Xms"$id"M -Xmx"$id"M -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar spigot-$version.jar" >start.sh
  22. chmod +x start.sh
  23. while true; do
  24.     printf "\e[100m\n-------------------------------------------------\n| Do you want the optimized bukkit/spigot.yml configs? [Y/N] |\n-------------------------------------------------\n\e[49m"
  25.     read yd
  26.     case $yd in
  27.         [Yy]* ) curl -o bukkit.yml https://pastebin.com/raw/Nvr050Bt && curl -o spigot.yml https://pastebin.com/raw/6TxGDeRG; break;;
  28.         [Nn]* ) printf "\nConfig will not be optimized.\n"; break;;
  29.         * ) printf "\nPlease answer Y or N.\n" break;;
  30.     esac
  31. done
  32. while true; do
  33.     printf "\e[100m\n-------------------------------------------------\n| Do you want to install some basics plugins? [Y/N] |\n| The plugins are: ViaVersion,LuckPerms,Essentials |\n-------------------------------------------------\n\e[49m"
  34.     read yn
  35.     case $yn in
  36.         [Yy]* ) cd plugins/ && wget https://ci.ender.zone/job/EssentialsX/lastStableBuild/artifact/Essentials/target/EssentialsX-2.17.1.19.jar && wget https://ci.viaversion.com/job/ViaVersion/373/artifact/jar/target/ViaVersion-2.1.4-SNAPSHOT.jar && wget https://ci.lucko.me/job/LuckPerms/920/artifact/bukkit/build/libs/LuckPerms-Bukkit-4.4.31.jar && cd ..; break;;
  37.         [Nn]* ) printf "\nAddons will not be installed.\n"; break;;
  38.         * ) printf "Please answer Y or N.\n"; break;;
  39.     esac
  40. done
  41. printf "eula=true" >eula.txt
  42. while true; do
  43.     printf "\e[100m\n------------------------- \n| Do you want to start the server? [Y/N] |\n------------------------\n\e[49m"
  44.     read yn2
  45.     case $yn2 in
  46.         [Yy]* ) screen -dmS $servername bash -c 'bash start.sh'; break;;
  47.         [Nn]* ) printf "\n| Setup now FINISHED \n\n"; break;;
  48.     esac
  49. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement