-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeyser.sh
61 lines (53 loc) · 1.54 KB
/
geyser.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Install and update GeyserMC: https://geysermc.org/
# Tested on Debian/Ubuntu systems and WSL: https://docs.microsoft.com/en-us/windows/wsl/install-win10
# Dependencies - jq (https://stedolan.github.io/jq/), curl, and Java
# Created by Travis Kipp
#Colors
RESET='\e[0m'
GREEN='\e[92m'
RED='\e[91m'
BCYAN='\e[36m\e[1m'
BWHITE='\e[97m'
YELLOW='\e[93m'
TAG="${BCYAN}[Paper Tray]${RESET} "
#Overwrite default settings from papertray.conf
source papertray.conf
onlineCheck() {
wget -q --spider https://ci.nukkitx.com
if [ $? -eq 0 ]; then
echo -e "${TAG}${GREEN}GeyserMC Build Server online"
else
echo -e "${TAG}${RED}Unable to connect to GeyserMC Build Server"
printf "${TAG}${YELLOW}Start server [Y/n]? ${RESET}"
read -r answer
if [ "$answer" = "" ] || [ "$answer" = "Y" ] || [ "$answer" = "y" ] ; then
startLoop
else
exitScript
fi
fi
}
folderCheck() {
if [ -d "plugins" ]; then
echo -e "${TAG}Plugins folder found"
geyserDownload
else
echo -e "${TAG}${RED}Plugins folder not found"
mkdir -p "plugins"
echo -e "${TAG}Created plugins folder"
fi
}
#Get lastest build from Geyser API
geyserDownload() {
curl -o plugins/geyser.jar "https://ci.nukkitx.com/job/GeyserMC/job/Geyser/job/master/lastSuccessfulBuild/artifact/bootstrap/spigot/target/Geyser-Spigot.jar"
#echo -e $latest_build > .pt_gy_current_build.txt
echo -e "${TAG}Downloaded lastest build of Geyser"
}
#exit 1
exitScript() {
echo -e "${TAG}${RED}Exiting...${RESET}"
exit 1
}
onlineCheck
folderCheck