├── .gitignore ├── LICENSE ├── debug.sh ├── paper.sh ├── README.md └── .server └── start.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Intellij 2 | .idea/ 3 | 4 | # Servers 5 | .paper/ 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Monun 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /debug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | server='https://papermc.io/api/v1/paper/1.17.1/latest/download' 4 | plugins=( 5 | 'https://github.com/monun/auto-reloader/releases/latest/download/AutoReloader.jar' 6 | ) 7 | 8 | script=$(basename "$0") 9 | server_folder=".${script%.*}" 10 | mkdir -p "$server_folder" 11 | 12 | start_script="start.sh" 13 | start_config="$start_script.conf" 14 | 15 | if [ ! -f "$server_folder/$start_script" ]; then 16 | if [ -f ".server/$start_script" ]; then 17 | cp ".server/$start_script" "$server_folder/$start_script" 18 | else 19 | wget -qc -P "$server_folder" -N "https://raw.githubusercontent.com/monun/server-script/master/.server/$start_script" 20 | wget -qc -P "$server_folder" -N "https://raw.githubusercontent.com/monun/server-script/master/.server/start.bat" 21 | fi 22 | fi 23 | 24 | cd "$server_folder" || exit 25 | 26 | if [ ! -f "$start_config" ]; then 27 | cat <$start_config 28 | server=$server 29 | debug=true 30 | debug_port=5005 31 | backup=false 32 | force_restart=false 33 | memory=16 34 | plugins=( 35 | EOF 36 | for plugin in "${plugins[@]}"; do 37 | echo " \"$plugin\"" >>$start_config 38 | done 39 | echo ")" >>$start_config 40 | fi 41 | 42 | chmod +x ./$start_script 43 | ./$start_script launch 44 | -------------------------------------------------------------------------------- /paper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | server='https://papermc.io/api/v1/paper/1.17.1/latest/download' 4 | plugins=( 5 | 'https://github.com/monun/auto-reloader/releases/latest/download/AutoReloader.jar' 6 | ) 7 | 8 | script=$(basename "$0") 9 | server_folder=".${script%.*}" 10 | mkdir -p "$server_folder" 11 | 12 | start_script="start.sh" 13 | start_config="$start_script.conf" 14 | 15 | if [ ! -f "$server_folder/$start_script" ]; then 16 | if [ -f ".server/$start_script" ]; then 17 | cp ".server/$start_script" "$server_folder/$start_script" 18 | else 19 | wget -qc -P "$server_folder" -N "https://raw.githubusercontent.com/monun/server-script/master/.server/$start_script" 20 | wget -qc -P "$server_folder" -N "https://raw.githubusercontent.com/monun/server-script/master/.server/start.bat" 21 | fi 22 | fi 23 | 24 | cd "$server_folder" || exit 25 | 26 | if [ ! -f "$start_config" ]; then 27 | cat <$start_config 28 | server=$server 29 | debug=false 30 | debug_port=5005 31 | backup=false 32 | force_restart=false 33 | memory=16 34 | plugins=( 35 | EOF 36 | for plugin in "${plugins[@]}"; do 37 | echo " \"$plugin\"" >>$start_config 38 | done 39 | echo ")" >>$start_config 40 | fi 41 | 42 | chmod +x ./$start_script 43 | ./$start_script launch 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 마인크래프트 서버 간단하게 구축하기 2 | 3 | 윈도우 유저분들은 WSL혹은 mingw64를 통해 실행하세요. 4 | 5 | #### mingw64 6 | 7 | * git을 설치하면 `C:\Program Files\Git\mingw64` 경로에 자동으로 설치됩니다. 8 | * 환경변수 PATH에 `C:\Program Files\Git\mingw64\bin` 을 추가하세요. 9 | * [wget.exe](https://eternallybored.org/misc/wget/) 파일을 다운로드하여 mingw64 폴더에 넣어주세요. 10 | 11 | ### 환경 12 | 13 | * JAVA 14 | * LINUX (shell) 15 | 16 | --- 17 | 18 | ## 사용방법 (아래 방법중 하나를 선택하세요) 19 | 20 | ### - start.sh (기본) 21 | 22 | 1. .server/start.sh 파일을 다운로드 `wget https://raw.githubusercontent.com/monun/server-script/master/.server/start.sh` 23 | 2. 실행권한 부여 `chmod +x ./start.sh` 24 | 3. 실행 `./start.sh` (현재 폴더에서 서버 실행됨) 25 | 4. [선택] 서버 시작시 생성된 ./start.sh.conf 파일을 필요대로 수정 26 | 27 | ### - \.sh (사전 설정 가능) 28 | 29 | 1. 원하는 스크립트 선택 (아래 방법 중 하나를 선택) 30 | * 예) paper 스크립트 다운로드 `wget https://raw.githubusercontent.com/monun/server-script/master/paper.sh` 31 | * 예) 프로젝트를 복제 `git clone https://github.com/monun/server-script.git` 32 | 2. [선택] 스크립트를 수정 (플러그인, 백업, 재시작 등) 33 | 3. 실행권한 부여 `chmod +x ./