-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallJava
More file actions
124 lines (107 loc) · 3.73 KB
/
installJava
File metadata and controls
124 lines (107 loc) · 3.73 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
export THIS_DIR=$PWD
export DEBIAN_FRONTEND=noninteractive
# ===== COLORS =====
GREEN="\e[32m"
CYAN="\e[36m"
YELLOW="\e[33m"
RED="\e[31m"
GRAY="\e[90m"
RESET="\e[0m"
clear
# ===== HEADER =====
echo -e "${CYAN}"
echo "========================================="
echo " Minecraft Java Server Installer"
echo "========================================="
echo -e "${RESET}"
install_server () {
choice=$1
echo ""
echo -e "${CYAN}> Preparing installation...${RESET}"
sleep 1
case "$choice" in
1)
echo -e "${GREEN}> Installing Vanilla Server${RESET}"
bash <(curl -s https://raw.githubusercontent.com/hapis1703/minecraftserver/main/Java/vanilla)
;;
2)
echo -e "${GREEN}> Installing Paper Server${RESET}"
bash <(curl -s https://raw.githubusercontent.com/hapis1703/minecraftserver/main/Java/paper)
;;
3)
echo -e "${GREEN}> Installing Fabric Server${RESET}"
bash <(curl -s https://raw.githubusercontent.com/hapis1703/minecraftserver/main/Java/fabric)
;;
4)
echo -e "${GREEN}> Installing Folia Server${RESET}"
bash <(curl -s https://raw.githubusercontent.com/hapis1703/minecraftserver/main/Java/folia)
;;
5)
echo -e "${GREEN}> Installing Forge Server${RESET}"
bash <(curl -s https://raw.githubusercontent.com/hapis1703/minecraftserver/main/Java/forge)
;;
6)
echo -e "${GREEN}> Installing NeoForge Server${RESET}"
bash <(curl -s https://raw.githubusercontent.com/hapis1703/minecraftserver/main/Java/neoforge)
;;
7)
echo -e "${GREEN}> Installing Pufferfish Server${RESET}"
bash <(curl -s https://raw.githubusercontent.com/hapis1703/minecraftserver/main/Java/pufferfish)
;;
8)
echo -e "${GREEN}> Installing Purpur Server${RESET}"
bash <(curl -s https://raw.githubusercontent.com/hapis1703/minecraftserver/main/Java/purpur)
;;
9)
echo -e "${GREEN}> Installing Quilt Server${RESET}"
bash <(curl -s https://raw.githubusercontent.com/hapis1703/minecraftserver/main/Java/quilt)
;;
*)
echo -e "${RED}> Invalid selection. Restarting installer...${RESET}"
sleep 1
bash <(curl -s https://raw.githubusercontent.com/hapis1703/minecraftserver/main/installJava)
exit 1
;;
esac
}
# ===== DEPENDENCIES =====
echo -e "${CYAN}> Updating system & installing tools...${RESET}"
sudo apt update -qq
sudo apt install -y -qq screen neofetch
# ===== INFO =====
echo ""
echo -e "${YELLOW}IMPORTANT:${RESET} Using mcutils.com API"
echo -e "${GRAY}Available versions may be limited${RESET}"
echo ""
# ===== MENU =====
echo -e "${CYAN}Select Server Type:${RESET}"
echo ""
echo " [1] Vanilla"
echo " [2] Paper"
echo " [3] Fabric"
echo " [4] Folia"
echo " [5] Forge"
echo " [6] NeoForge"
echo " [7] Pufferfish"
echo " [8] Purpur"
echo " [9] Quilt"
echo ""
read -rp "Enter choice [1-9]: " SERVER_TYPE
install_server "$SERVER_TYPE"
# ===== PLAYIT =====
echo ""
echo -e "${CYAN}> Installing Playit.gg...${RESET}"
cd ..
curl -SsL https://playit-cloud.github.io/ppa/key.gpg \
| gpg --dearmor \
| sudo tee /etc/apt/trusted.gpg.d/playit.gpg >/dev/null
echo "deb [signed-by=/etc/apt/trusted.gpg.d/playit.gpg] https://playit-cloud.github.io/ppa/data ./" \
| sudo tee /etc/apt/sources.list.d/playit-cloud.list >/dev/null
sudo apt update -qq
sudo apt install -y -qq playit
# ===== DONE =====
echo ""
echo -e "${GREEN}✔ Installation Completed Successfully!${RESET}"
echo -e "${CYAN}> Start your server with:${RESET} ./start"
echo ""