Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- sudo apt install openjdk-8-jre-headless screen ufw curl -y
- read -p $'\e[44mChoose this server name\e[0m: ' servername
- mkdir -p minecraft/$servername/plugins && cd minecraft/$servername
- 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"
- read -p $'\e[44mVersion\e[0m: ' version
- wget https://cdn.getbukkit.org/spigot/spigot-$version.jar
- printf "\e[100m\n----------------------------------------------\n| Select the port to be opened for the server . |\n----------------------------------------------\n\e[49m"
- read -p $'\e[44mPort\e[0m: ' port
- printf "\e[100m\n----------------------------------------------\n| You want server online-mode? [true/false]. |\n----------------------------------------------\n\e[49m"
- read -p $'\e[44monline-mode=\e[0m' mode
- if [ "$mode" == "false" ]; then
- printf "server-port=$port\nonline-mode=false" >server.properties
- else
- printf "SETTING TO DEFAULT.\n"
- printf "server-port=$port" >server.properties
- fi
- sudo ufw allow $port/tcp && sudo ufw reload
- printf "\e[100m\n------------------------------------------------------------\n| How much DRAM will the server be able to use? (In MEGABYTES) |\n------------------------------------------------------------\n\e[49m"
- read -p $'\e[44mValue\e[0m: ' id
- 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
- chmod +x start.sh
- while true; do
- printf "\e[100m\n-------------------------------------------------\n| Do you want the optimized bukkit/spigot.yml configs? [Y/N] |\n-------------------------------------------------\n\e[49m"
- read yd
- case $yd in
- [Yy]* ) curl -o bukkit.yml https://pastebin.com/raw/Nvr050Bt && curl -o spigot.yml https://pastebin.com/raw/6TxGDeRG; break;;
- [Nn]* ) printf "\nConfig will not be optimized.\n"; break;;
- * ) printf "\nPlease answer Y or N.\n" break;;
- esac
- done
- while true; do
- 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"
- read yn
- case $yn in
- [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;;
- [Nn]* ) printf "\nAddons will not be installed.\n"; break;;
- * ) printf "Please answer Y or N.\n"; break;;
- esac
- done
- printf "eula=true" >eula.txt
- while true; do
- printf "\e[100m\n------------------------- \n| Do you want to start the server? [Y/N] |\n------------------------\n\e[49m"
- read yn2
- case $yn2 in
- [Yy]* ) screen -dmS $servername bash -c 'bash start.sh'; break;;
- [Nn]* ) printf "\n| Setup now FINISHED \n\n"; break;;
- esac
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement