Create install-spigot.sh

This commit is contained in:
cedricAbonnel 2020-05-16 21:28:38 +02:00 committed by GitHub
parent 99ce975032
commit f9a88f26f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 58 additions and 0 deletions

58
scripts/install-spigot.sh Normal file
View File

@ -0,0 +1,58 @@
#!/bin/bash
#
# Définitions de fonctions
#
printMessage () {
echo -e "\n$Yellow$1$Cyan"
$1>>~/infos_minecraft.txt
}
#
# Définitions de variables
#
# Regular Colors
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Purple='\033[0;35m' # Purple
Cyan='\033[0;36m' # Cyan
Color_Off='\033[0m' # Text Reset
#
# Debut du script
#
printMessage "\n[NFO] Installation des programmes"
sudo apt -y update
sudo apt -y upgrade
sudo apt -y install openjdk-11-jdk git
printMessage "\n[NFO] Préparation du dossier minecraft"
mkdir minecraft
cd minecraft
printMessage "\n[NFO] Récupération de BuildTools"
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
printMessage "\n[NFO] Execution de BuildTools"
java -Xmx1G -jar BuildTools.jar rev latest
printMessage "\n[NFO] Préparation du Lanceur"
cd
echo "cd ~/minecraft">~/start.sh
echo "java -Xms1G -Xmx1G -XX:+UseConcMarkSweepGC -jar ~/minecraft/spigot-1.15.2.jar nogui">>~/start.sh
sudo chmod +x ~/start.sh
sed -i 's/false/true/g' ~/minecraft/eula.txt
printMessage "\n[NFO] Execution du lanceur"
~/start.sh
# astuce : executer le script et quitter la session avec la commande
# nohup ~/start.sh&