mc: create FTB/CF server start script when absent

Fixes #294
This commit is contained in:
Geoff Bourne
2019-03-10 21:50:42 -05:00
parent aef8f54903
commit 36f5857de3
2 changed files with 15 additions and 3 deletions

View File

@@ -73,8 +73,20 @@ if [[ $startScriptCount = 0 ]]; then
fi
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l) = 0 ]]; then
echo "Please make sure you are using the server version of the FTB modpack!"
exit 2
forgeJar=$(find ${FTB_BASE_DIR} -name 'forge*.jar' -a -not -name 'forge*installer')
if [[ $forgeJar ]]; then
echo "No entry script found, so building one for ${forgeJar}"
cat > ${FTB_BASE_DIR}/ServerStart.sh <<EOF
#!/bin/sh
. ./settings-local.sh
java \${JAVA_PARAMETERS} -Xmx\${MAX_RAM} -jar ${forgeJar} nogui
EOF
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
export FTB_SERVER_START=$(find ${FTB_BASE_DIR} $entryScriptExpr)

View File

@@ -25,7 +25,7 @@ fi
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
echo "Checking for JSON files."
JSON_FILES=$(find . -name '*.json')
JSON_FILES=$(find . -maxdepth 1 -name '*.json')
for j in $JSON_FILES; do
if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then
echo "Fixing JSON $j"