mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 23:16:24 +00:00
Compare commits
21 Commits
2021.11.0-
...
2021.8.0-j
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
004cbdb9f7 | ||
|
|
45856a1a81 | ||
|
|
1e615e76e8 | ||
|
|
1c85a685de | ||
|
|
7cd207f40b | ||
|
|
140a8aa90c | ||
|
|
76dcff9d18 | ||
|
|
a9a86d249b | ||
|
|
595760d301 | ||
|
|
6d3f194ce3 | ||
|
|
21c1620f0c | ||
|
|
e78e5af96d | ||
|
|
0fb9700fc7 | ||
|
|
18925ef32c | ||
|
|
f06b990f8a | ||
|
|
75844ae81a | ||
|
|
6bb2323c46 | ||
|
|
7814ca21b5 | ||
|
|
b8806629ec | ||
|
|
4a7f838a0f | ||
|
|
2d07dee4df |
@@ -1,25 +0,0 @@
|
||||
version: 2
|
||||
jobs:
|
||||
minecraft_server:
|
||||
docker:
|
||||
- image: circleci/buildpack-deps:stable
|
||||
steps:
|
||||
- checkout
|
||||
- setup_remote_docker
|
||||
- run:
|
||||
name: Build image
|
||||
command: docker build -t itzg/minecraft-server:${CIRCLE_BRANCH} .
|
||||
# - run:
|
||||
# name: Build arm v7 image
|
||||
# command: docker build -t itzg/minecraft-server:${CIRCLE_BRANCH}-arm-v7 --platform linux/arm/v7 --build-arg ARCH=armv7 .
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
jobs:
|
||||
- minecraft_server:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- armv7
|
||||
- multiarch
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM adoptopenjdk/openjdk8-openj9:alpine
|
||||
FROM openjdk:8u212-jre-alpine
|
||||
|
||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||
|
||||
@@ -69,7 +69,7 @@ WORKDIR /data
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
ENV UID=1000 GID=1000 \
|
||||
MEMORY="1G" \
|
||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||
TYPE=VANILLA VERSION=LATEST \
|
||||
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||
SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
||||
|
||||
34
README.md
34
README.md
@@ -262,7 +262,7 @@ If you want old mods to be removed as the `/mods` content is updated, then add `
|
||||
|
||||
For example: `-e REMOVE_OLD_MODS=TRUE -e REMOVE_OLD_MODS_INCLUDE="*.jar" -e REMOVE_OLD_MODS_DEPTH=1` will remove all old jar files that are directly inside the `plugins/` or `mods/` directory.
|
||||
|
||||
You can specify the destination of the files that are copied from `/mods` and `/config` by setting the `COPY_MODS_DEST` and `COPY_CONFIG_DEST`, where the default is `/data/mods` and `/data/config`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory.
|
||||
You can specify the destination of the files that are copied from `/config` by setting the `COPY_CONFIG_DEST` variable, where the default is `/data/config`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory.
|
||||
|
||||
> NOTE: If a file was updated in the destination path and is newer than the source file from `/config`, then it will not be overwritten.
|
||||
|
||||
@@ -327,10 +327,6 @@ An [Airplane](https://github.com/TECHNOVE/Airplane) server, which is a fork of T
|
||||
|
||||
> **NOTE** only Java 8 and 11 are supported
|
||||
|
||||
Extra variables:
|
||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the [Flare](https://blog.airplane.gg/flare) profiler
|
||||
|
||||
## Running a Purpur server
|
||||
|
||||
A [Purpur](https://purpur.pl3x.net/) server, which is "a fork of Paper, Tuinity, Airplane with the goal of providing new and interesting configuration options".
|
||||
@@ -342,7 +338,6 @@ A [Purpur](https://purpur.pl3x.net/) server, which is "a fork of Paper, Tuinity,
|
||||
Extra variables:
|
||||
- `PURPUR_BUILD=LATEST` : set a specific Purpur build to use
|
||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the [Flare](https://blog.airplane.gg/flare) profiler
|
||||
|
||||
## Running a Yatopia server
|
||||
|
||||
@@ -355,7 +350,6 @@ A [Yatopia](https://github.com/YatopiaMC/Yatopia) server, which is a "blazing fa
|
||||
Extra variables:
|
||||
- `RELEASE=stable` : set to `stable` or `latest`
|
||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the [Flare](https://blog.airplane.gg/flare) profiler
|
||||
|
||||
## Running a Magma server
|
||||
|
||||
@@ -512,9 +506,9 @@ the `/path/on/host` folder contents look like:
|
||||
```
|
||||
/path/on/host
|
||||
├── mods
|
||||
│ └── ... INSTALL MODS HERE ...
|
||||
│ └── ... INSTALL MODS HERE ...
|
||||
├── config
|
||||
│ └── ... CONFIGURE MODS HERE ...
|
||||
│ └── ... CONFIGURE MODS HERE ...
|
||||
├── ops.json
|
||||
├── server.properties
|
||||
├── whitelist.json
|
||||
@@ -527,20 +521,24 @@ up:
|
||||
docker stop mc
|
||||
docker start mc
|
||||
|
||||
## Optional plugins, mods, and config attach points
|
||||
### Using separate mounts
|
||||
|
||||
There are optional volume paths that can be attached to supply content to be copied into the data area:
|
||||
This is the easiest way if you are using an ephemeral `/data` filesystem,
|
||||
or downloading a world with the `WORLD` option.
|
||||
|
||||
`/plugins`
|
||||
: contents are copied into `/data/plugins` for Bukkit related server types. Set `PLUGINS_SYNC_UPDATE=false` if you want files from `/plugins` to take precedence over newer files in `/data/plugins`.
|
||||
There are two additional volumes that can be mounted; `/mods` and `/config`.
|
||||
Any files in either of these filesystems will be copied over to the main
|
||||
`/data` filesystem before starting Minecraft.
|
||||
|
||||
`/mods`
|
||||
: contents are copied into `/data/mods` for Forge related server types
|
||||
This works well if you want to have a common set of modules in a separate
|
||||
location, but still have multiple worlds with different server requirements
|
||||
in either persistent volumes or a downloadable archive.
|
||||
|
||||
`/config`
|
||||
: contents are copied into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`
|
||||
## Deploying plugins from attached volume
|
||||
|
||||
These paths work well if you want to have a common set of modules in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive.
|
||||
If the `/plugins` directory exists in the container, such as from an attached volume, any files in this directory will be copied over to `/data/plugins` before starting Minecraft. Set `PLUGINS_SYNC_UPDATE=false` if you want files from `/plugins` to take precedence over newer files in `/data/plugins`.
|
||||
|
||||
This works well if you want to have a common set of plugins in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive.
|
||||
|
||||
## Auto-downloading SpigotMC/Bukkit/PaperMC plugins
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ fi
|
||||
|
||||
if ! which java > /dev/null; then
|
||||
log "Fixing PATH to include java"
|
||||
PATH="${PATH}:/opt/java/openjdk/bin"
|
||||
PATH="${PATH}:/usr/bin"
|
||||
fi
|
||||
|
||||
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||
@@ -105,12 +105,6 @@ case "${TYPE^^}" in
|
||||
;;
|
||||
|
||||
FORGE)
|
||||
log "**********************************************************************"
|
||||
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
||||
log " since some mods require Java 8"
|
||||
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
|
||||
log " can be fixed with java8"
|
||||
log "**********************************************************************"
|
||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||
;;
|
||||
|
||||
@@ -119,12 +113,6 @@ case "${TYPE^^}" in
|
||||
;;
|
||||
|
||||
FTB|CURSEFORGE)
|
||||
log "**********************************************************************"
|
||||
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
||||
log " since some mods require Java 8"
|
||||
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
|
||||
log " can be fixed with java8"
|
||||
log "**********************************************************************"
|
||||
exec ${SCRIPTS:-/}start-deployCF "$@"
|
||||
;;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ fi
|
||||
|
||||
export SERVER=airplane-${VANILLA_VERSION}-jdk${JAVA_VER}.jar
|
||||
|
||||
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||
if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
downloadUrl="https://dl.airplane.gg/latest/Airplane-JDK${JAVA_VER}/launcher-airplane.jar"
|
||||
log "Downloading Airplane from $downloadUrl ..."
|
||||
curl -fsSL -o "$SERVER" "$downloadUrl"
|
||||
@@ -33,4 +33,5 @@ fi
|
||||
export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
|
||||
@@ -27,7 +27,7 @@ isDebugging && set -x
|
||||
export FTB_BASE_DIR
|
||||
|
||||
legacyJavaFixerUrl=https://ftb.forgecdn.net/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
|
||||
export TYPE=CURSEFORGE
|
||||
export TYPE=FEED-THE-BEAST
|
||||
|
||||
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
|
||||
|
||||
@@ -60,8 +60,8 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
|
||||
mkdir -p ${FTB_BASE_DIR}
|
||||
unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||
|
||||
SERVER=$(find ${FTB_BASE_DIR} -type f -not -name "forge*installer.jar" -name "forge*.jar")
|
||||
if [[ -z "$SERVER" ]]; then
|
||||
serverJar=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
|
||||
if [[ -z "$serverJar" ]]; then
|
||||
|
||||
if [ -f "${FTB_BASE_DIR}/settings.cfg" ]; then
|
||||
loadForgeVars "${FTB_BASE_DIR}/settings.cfg"
|
||||
@@ -89,15 +89,14 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
|
||||
fi
|
||||
|
||||
echo "${FTB_SERVER_MOD}" > $installMarker
|
||||
SERVER=$(find ${FTB_BASE_DIR} -type f -not -name "forge*installer.jar" -name "forge*.jar")
|
||||
fi
|
||||
|
||||
export SERVER=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
|
||||
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
|
||||
log "ERROR unable to locate installed forge server jar"
|
||||
isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar"
|
||||
exit 2
|
||||
fi
|
||||
export SERVER
|
||||
|
||||
export FTB_DIR=$(dirname "${SERVER}")
|
||||
|
||||
@@ -168,16 +167,6 @@ if [[ $startScriptCount = 0 ]]; then
|
||||
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||
mkdir -p ${FTB_BASE_DIR}
|
||||
unzip -o "${srv_modpack}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||
|
||||
installScript=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f -name install.sh)
|
||||
if [[ "$installScript" ]]; then
|
||||
(
|
||||
cd "$(dirname "${installScript}")"
|
||||
chmod +x ./install.sh
|
||||
log "Running included install.sh"
|
||||
./install.sh
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
|
||||
|
||||
@@ -34,4 +34,5 @@ fi
|
||||
export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
|
||||
@@ -23,4 +23,5 @@ fi
|
||||
# Normalize on Spigot for later operations
|
||||
export TYPE=SPIGOT
|
||||
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
|
||||
@@ -42,7 +42,7 @@ if isTrue "${REPLACE_ENV_VARIABLES}"; then
|
||||
$dirExcludes \
|
||||
-type f \
|
||||
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
|
||||
-or -name "*.conf" -or -name "*.properties" -or -name "*.hjson" -or -name "*.json" \) \
|
||||
-or -name "*.conf" -or -name "*.properties" \) \
|
||||
$fileExcludes \
|
||||
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
||||
done
|
||||
|
||||
@@ -11,9 +11,21 @@ fi
|
||||
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
||||
|
||||
# Remove old mods/plugins
|
||||
if isTrue ${REMOVE_OLD_MODS:-false}; then
|
||||
removeOldMods /data/mods
|
||||
removeOldMods /data/plugins
|
||||
if isTrue ${REMOVE_OLD_MODS}; then
|
||||
remove_mods_dest="/data/mods"
|
||||
case ${TYPE} in
|
||||
SPIGOT|BUKKIT|PAPER)
|
||||
remove_mods_dest="/data/plugins"
|
||||
;;
|
||||
esac
|
||||
|
||||
# only try to remove existing mods dir
|
||||
if [ -d "$remove_mods_dest" ]; then
|
||||
log "Removing old mods in $remove_mods_dest..."
|
||||
find $remove_mods_dest -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
|
||||
else
|
||||
log "Directory $remove_mods_dest does not exist; removing nothing."
|
||||
fi
|
||||
fi
|
||||
|
||||
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
||||
@@ -25,12 +37,12 @@ if [[ "$MODPACK" ]]; then
|
||||
downloadUrl=$(curl -Ls -o /dev/null -w %{effective_url} $MODPACK)
|
||||
if ! [[ $downloadUrl == *.zip ]]; then
|
||||
log "ERROR Invalid URL given for MODPACK: $downloadUrl resolved from $MODPACK"
|
||||
log " Must be HTTP, HTTPS or FTP and a ZIP file"
|
||||
log " Must be HTTP or HTTPS and a ZIP file"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
log "Downloading mod/plugin pack"
|
||||
log "Downloading mod/plugin pack via HTTP"
|
||||
log " from $downloadUrl ..."
|
||||
if ! curl -sSL -o /tmp/modpack.zip "$downloadUrl"; then
|
||||
log "ERROR: failed to download from $downloadUrl"
|
||||
|
||||
@@ -21,12 +21,10 @@ if [ -d /plugins ]; then
|
||||
fi
|
||||
|
||||
# If any modules have been provided, copy them over
|
||||
: ${COPY_MODS_DEST:="/data/mods"}
|
||||
|
||||
if [ -d /mods ]; then
|
||||
log "Copying any mods over..."
|
||||
mkdir -p $COPY_MODS_DEST
|
||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods/ $COPY_MODS_DEST
|
||||
mkdir -p /data/mods
|
||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods /data
|
||||
fi
|
||||
|
||||
: ${COPY_CONFIG_DEST:="/data/config"}
|
||||
|
||||
@@ -181,8 +181,8 @@ function customizeServerProps {
|
||||
}
|
||||
|
||||
# Deploy server.properties file
|
||||
if [[ ${TYPE} == "CURSEFORGE" ]]; then
|
||||
export SERVER_PROPERTIES="${FTB_DIR}/server.properties"
|
||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
|
||||
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
|
||||
fi
|
||||
|
||||
@@ -214,7 +214,7 @@ fi
|
||||
|
||||
if isDebugging; then
|
||||
log "DEBUG Dumping server.properties"
|
||||
cat "${SERVER_PROPERTIES}"
|
||||
cat /data/server.properties
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-finalSetupEnvVariables $@
|
||||
|
||||
@@ -7,7 +7,7 @@ isDebugging && set -x
|
||||
: ${LEVEL:=world}
|
||||
export LEVEL
|
||||
|
||||
if [ $TYPE = "CURSEFORGE" ]; then
|
||||
if [ $TYPE = "FEED-THE-BEAST" ]; then
|
||||
worldDest=$FTB_DIR/$LEVEL
|
||||
else
|
||||
worldDest=/data/$LEVEL
|
||||
|
||||
@@ -81,23 +81,6 @@ if [ -n "$JVM_DD_OPTS" ]; then
|
||||
done
|
||||
fi
|
||||
|
||||
if isTrue ${TUNE_VIRTUALIZED}; then
|
||||
JVM_XX_OPTS="${JVM_XX_OPTS} -Xtune:virtualized"
|
||||
fi
|
||||
|
||||
if isTrue ${TUNE_NURSERY_SIZES}; then
|
||||
case ${MAX_MEMORY^^} in
|
||||
*G)
|
||||
MAX_MEMORY_MB=$(( ${MAX_MEMORY%?} * 1024 )) ;;
|
||||
*M)
|
||||
MAX_MEMORY_MB=${MAX_MEMORY%?} ;;
|
||||
esac
|
||||
|
||||
NURSERY_MINIMUM=$(( ${MAX_MEMORY_MB} / 2 ))
|
||||
NURSERY_MAXIMUM=$(( ${MAX_MEMORY_MB} * 4/5 ))
|
||||
JVM_XX_OPTS="${JVM_XX_OPTS} -Xmns${NURSERY_MINIMUM}M -Xmnx${NURSERY_MAXIMUM}M"
|
||||
fi
|
||||
|
||||
if isTrue ${ENABLE_JMX}; then
|
||||
: ${JMX_PORT:=7091}
|
||||
JVM_OPTS="${JVM_OPTS}
|
||||
@@ -161,13 +144,6 @@ if isTrue "${USE_LARGE_PAGES}"; then
|
||||
"
|
||||
fi
|
||||
|
||||
if isTrue "${USE_FLARE_FLAGS}"; then
|
||||
JVM_XX_OPTS="${JVM_XX_OPTS}
|
||||
-XX:+UnlockDiagnosticVMOptions
|
||||
-XX:+DebugNonSafepoints
|
||||
"
|
||||
fi
|
||||
|
||||
if isTrue "${DEBUG_MEMORY}"; then
|
||||
log "Memory usage and availability (in MB)"
|
||||
uname -a
|
||||
@@ -197,7 +173,7 @@ if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then
|
||||
exec mc-server-runner ${mcServerRunnerArgs} \
|
||||
--cf-instance-file "${CURSE_INSTANCE_JSON}" \
|
||||
java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar _SERVERJAR_ "$@" $EXTRA_ARGS
|
||||
elif [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then
|
||||
elif [[ ${TYPE} == "FEED-THE-BEAST" && "${SERVER}" ]]; then
|
||||
copyFilesForCurseForge
|
||||
|
||||
cd "${FTB_DIR}"
|
||||
@@ -206,7 +182,7 @@ elif [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then
|
||||
set -x
|
||||
fi
|
||||
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $(basename "${SERVER}") "$@" $EXTRA_ARGS
|
||||
elif [[ ${TYPE} == "CURSEFORGE" ]]; then
|
||||
elif [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
mcServerRunnerArgs="${mcServerRunnerArgs} --shell bash"
|
||||
|
||||
copyFilesForCurseForge
|
||||
|
||||
12
start-spiget
12
start-spiget
@@ -16,7 +16,7 @@ containsJars() {
|
||||
if [[ $line =~ $pat ]]; then
|
||||
return 0
|
||||
fi
|
||||
done <<<$(unzip -l "$file")
|
||||
done <<< $(unzip -l "$file")
|
||||
|
||||
return 1
|
||||
}
|
||||
@@ -46,14 +46,10 @@ getResourceFromSpiget() {
|
||||
}
|
||||
|
||||
if [[ ${SPIGET_RESOURCES} ]]; then
|
||||
if isTrue ${REMOVE_OLD_MODS:-false}; then
|
||||
removeOldMods /data/plugins
|
||||
REMOVE_OLD_MODS=false
|
||||
fi
|
||||
|
||||
log "Getting plugins via Spiget"
|
||||
IFS=',' read -r -a resources <<<"${SPIGET_RESOURCES}"
|
||||
for resource in "${resources[@]}"; do
|
||||
IFS=',' read -r -a resources <<< "${SPIGET_RESOURCES}"
|
||||
for resource in "${resources[@]}"
|
||||
do
|
||||
getResourceFromSpiget "${resource}"
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -11,7 +11,7 @@ function join_by() {
|
||||
function isURL() {
|
||||
local value=$1
|
||||
|
||||
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" || ${value:0:6} == "ftp://" ]]; then
|
||||
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
@@ -174,9 +174,3 @@ eula=${EULA,,}
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
||||
function removeOldMods {
|
||||
if [ -d "$1" ]; then
|
||||
find "$1" -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user