#!/bin/bash ####################### Configuration Section ##################### # Use following variables as global-scope set -a ######################## Upstream Settings ######################### REPO_BASE_URL="https://raw.githubusercontent.com/monun/minecraft-server-launcher" REPO_BRANCH="master" REPO_ROOT="$REPO_BASE_URL/$REPO_BRANCH" REPO_DEPLOY="$REPO_ROOT/deploy" ########################## Configurations ########################## ## Server directory name DIR="server" ## Server type (local path or type[vanilla, spigot, paper]-version[1.xx.x, unspecified]-build[latest, unspecified, xx]-[dev]) SERVER="paper-1.21.4-latest-dev" ## Server memory (GB) MEMORY=4 ## When the server shuts down, use tar to back up. BACKUP=false ## The server will always restart. RESTART=false ################## Spigot or Paper Configurations ################## ## The maximum amount of players that the server will allow, this will bypass the max-players= value in server.properties file. PLAYERS=100 ## This parameter allows you to manually define the plugins directory to use for the server. PLUGINS="plugins" ## This parameter will put all worlds your server uses into a specific directory, it's useful if you have many folders inside in the main server directory. WORLDS="worlds" ## Server port, default value from server.properties (25565) PORT=-1 ## jdwp port, Enable debug mode when 0 or higher (5005) DEBUG_PORT=-1 # Preinstallation plugins (url) DEFAULT_PLUGINS=( # 'https://github.com/monun/auto-reloader/releases/download/0.0.6/auto-reloader-0.0.6.jar' ) # Uncomment to enable OpenJ9 performance tuning for VMs # VIRTUALIZED=true # Use following variables as local-scope set +a ####################### End of Configuration ###################### # Download itself if it is running from stdout (installation phase) [[ -t 1 ]] && [[ ! -f ./run ]] && wget -q -c --content-disposition -P . -N "$REPO_ROOT/run" >/dev/null && chmod +x ./run >/dev/null # Setup target directory mkdir -p "$DIR" && cd "$DIR" || exit [[ -d ../deploy ]] && cp -R ../deploy/* . [[ ! -f ./startSetup ]] && wget -q -c --content-disposition -P . -N "$REPO_DEPLOY/startSetup" >/dev/null chmod +x ./startSetup ./startSetup "${DEFAULT_PLUGINS[@]}"