mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
mc: properly generate server script when FTB/CF has spaces in path
For #342
This commit is contained in:
parent
b679edbd62
commit
ede30188b0
@ -76,20 +76,21 @@ if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
|
||||
|
||||
forgeJar=$(find ${FTB_BASE_DIR} -name 'forge*.jar' -a -not -name 'forge*installer')
|
||||
if [[ "$forgeJar" ]]; then
|
||||
export FTB_BASE_DIR=$(dirname "${forgeJar}")
|
||||
echo "No entry script found, so building one for ${forgeJar}"
|
||||
cat > ${FTB_BASE_DIR}/ServerStart.sh <<EOF
|
||||
cat > "${FTB_BASE_DIR}/ServerStart.sh" <<EOF
|
||||
#!/bin/sh
|
||||
. ./settings-local.sh
|
||||
java \${JAVA_PARAMETERS} -Xmx\${MAX_RAM} -jar ${forgeJar} nogui
|
||||
java \${JAVA_PARAMETERS} -Xmx\${MAX_RAM} -jar $(basename "${forgeJar}") nogui
|
||||
EOF
|
||||
chmod +x ${FTB_BASE_DIR}/ServerStart.sh
|
||||
chmod +x "${FTB_BASE_DIR}/ServerStart.sh"
|
||||
else
|
||||
echo "Please make sure you are using the server version of the FTB modpack!"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
scriptCount=$(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l)
|
||||
scriptCount=$(find "${FTB_BASE_DIR}" $entryScriptExpr | wc -l)
|
||||
if [[ $scriptCount = 0 ]]; then
|
||||
echo "Please make sure you are using the server version of the FTB modpack!"
|
||||
exit 2
|
||||
@ -100,7 +101,7 @@ elif [[ $scriptCount > 1 ]]; then
|
||||
exit 2
|
||||
fi
|
||||
|
||||
export FTB_SERVER_START=$(find ${FTB_BASE_DIR} $entryScriptExpr)
|
||||
export FTB_SERVER_START=$(find "${FTB_BASE_DIR}" $entryScriptExpr)
|
||||
|
||||
export FTB_DIR=$(dirname "${FTB_SERVER_START}")
|
||||
chmod a+x "${FTB_SERVER_START}"
|
||||
|
Loading…
Reference in New Issue
Block a user