forked from monun/psychics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.sh
More file actions
43 lines (36 loc) · 1.05 KB
/
debug.sh
File metadata and controls
43 lines (36 loc) · 1.05 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
#!/bin/bash
server='https://papermc.io/api/v1/paper/1.17.1/latest/download'
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/master/.server/$start_script"
wget -qc -P "$server_folder" -N "https://raw.githubusercontent.com/monun/server-script/master/.server/start.bat"
fi
fi
cd "$server_folder" || exit
if [ ! -f "$start_config" ]; then
cat <<EOF >$start_config
server=$server
debug=true
debug_port=5005
backup=false
force_restart=false
memory=16
plugins=(
EOF
for plugin in "${plugins[@]}"; do
echo " \"$plugin\"" >>$start_config
done
echo ")" >>$start_config
fi
chmod +x ./$start_script
./$start_script launch