-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·55 lines (40 loc) · 1.68 KB
/
init.sh
File metadata and controls
executable file
·55 lines (40 loc) · 1.68 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
#!/bin/bash
minecraft_path="/opt/minecraft"
# Create workspace
mkdir $minecraft_path
# Create minecraft user with home directory /opt/minecraft and no shell
sudo useradd -r -m -d $minecraft_path -s /bin/false minecraft
# Install java
apt-get -y update
apt install -y openjdk-21-jdk openjdk-21-jre
# Install paper
curl https://fill-data.papermc.io/v1/objects/18ba9d325ceecdf5028fd74bf6c8daa103426308b435bb44de7dadba27b5119b/paper-1.21.9-47.jar -o $minecraft_path/paper.jar
# Preaccept eula
echo "eula=true" > $minecraft_path/eula.txt
# Install BlueMap
mkdir $minecraft_path/plugins
curl -L https://github.com/BlueMap-Minecraft/BlueMap/releases/download/v5.12/bluemap-5.12-paper.jar -o $minecraft_path/plugins/bluemap.jar
# Install Banner Marker Plugin
curl -L https://cdn.modrinth.com/data/6G0lCDWV/versions/u9tkIHXP/BlueMap-BannerMarker.jar -o $minecraft_path/plugins/bbanner.jar
# Copy default logo
cp minecraft-configs/server-icon.png $minecraft_path
# Create service for mc server
cp start.sh $minecraft_path
cp start-mc_template.service /etc/systemd/system/start-minecraft.service
sed -i "s#<PATH>#$minecraft_path#g" /etc/systemd/system/start-minecraft.service
systemctl enable start-minecraft.service
systemctl start start-minecraft.service
echo "wait for mc server to start..."
sleep 60
# Set server config
cp minecraft-configs/whitelist.json $minecraft_path
cp minecraft-configs/server.properties $minecraft_path
mkdir $minecraft_path/plugins/BlueMap
cp minecraft-configs/bluemap-core.conf $minecraft_path/plugins/BlueMap/core.conf
# Set up nginx
./nginx-setup.sh $1
# Set permissions
sudo chown -R minecraft:minecraft $minecraft_path
# Restart
systemctl restart start-minecraft.service
echo "done."