generated from R2turnTrue/paper-sample
-
Notifications
You must be signed in to change notification settings - Fork 1
/
debug.sh
42 lines (35 loc) · 904 Bytes
/
debug.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
#!/bin/bash
plugins=(
'https://github.com/monun/auto-reloader/releases/latest/download/AutoReloader.jar'
)
script=$(basename "$0")
server_folder=".${script%.*}"
mkdir -p "$server_folder"
start_script="start.sh"
start_config="$start_script.conf"
if [ ! -f "$server_folder/$start_script" ]; then
if [ -f ".server/$start_script" ]; then
cp ".server/$start_script" "$server_folder/$start_script"
else
wget -qc -P "$server_folder" -N "https://raw.githubusercontent.com/monun/server-script/paper/.server/$start_script"
fi
fi
cd "$server_folder" || exit
if [ ! -f "$start_config" ]; then
cat <<EOF >$start_config
version=1.18.1
build=latest
debug=true
debug_port=5005
backup=false
force_restart=false
memory=6
plugins=(
EOF
for plugin in "${plugins[@]}"; do
echo " \"$plugin\"" >>$start_config
done
echo ")" >>$start_config
fi
chmod +x ./$start_script
./$start_script launch