mc: support CurseForge modpacks with LaunchServer.sh entry script

This commit is contained in:
Geoff Bourne
2018-09-30 14:39:37 -05:00
parent 44d2081b7b
commit 79756d13fd
+13 -8
View File
@@ -31,9 +31,9 @@ if [[ $startScriptCount = 0 ]]; then
srv_modpack=${FTB_SERVER_MOD} srv_modpack=${FTB_SERVER_MOD}
if isURL ${srv_modpack}; then if isURL ${srv_modpack}; then
case $srv_modpack in case $srv_modpack in
https://www.feed-the-beast.com/*/download) https://www.feed-the-beast.com/*/download|https://minecraft.curseforge.com/*/download)
;; ;;
https://www.feed-the-beast.com/*) https://www.feed-the-beast.com/*|https://minecraft.curseforge.com/*)
srv_modpack=${srv_modpack}/download;; srv_modpack=${srv_modpack}/download;;
esac esac
file=$(basename $(dirname $srv_modpack)) file=$(basename $(dirname $srv_modpack))
@@ -68,16 +68,21 @@ if [[ $startScriptCount = 0 ]]; then
unzip -o ${srv_modpack} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}' unzip -o ${srv_modpack} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
fi fi
if [[ $(find ${FTB_BASE_DIR} -name ServerStart.sh |wc -l) = 0 ]]; then if [[ $(find ${FTB_BASE_DIR} -name ServerStart.sh -o -name LaunchServer.sh |wc -l) = 0 ]]; then
echo "Please make sure you are using the server version of the FTB modpack!" echo "Please make sure you are using the server version of the FTB modpack!"
exit 2 exit 2
fi fi
export FTB_SERVER_START=./ServerStart.sh export FTB_SERVER_START=$(find ${FTB_BASE_DIR} -name ServerStart.sh -o -name LaunchServer.sh)
export FTB_DIR=$(dirname $(find ${FTB_DIR} -name ServerStart.sh)) if [[ $(echo ${FTB_SERVER_START} | wc -w) != 1 ]]; then
chmod a+x ${FTB_DIR}/${FTB_SERVER_START} echo "Please make sure you are using the server version of the FTB modpack!"
sed -i 's/-jar/-Dfml.queryResult=confirm -jar/' ${FTB_DIR}/${FTB_SERVER_START} exit 2
sed -i 's/.*read.*Restart now/#\0/' ${FTB_DIR}/${FTB_SERVER_START} fi
export FTB_DIR=$(dirname ${FTB_SERVER_START})
chmod a+x ${FTB_SERVER_START}
sed -i 's/-jar/-Dfml.queryResult=confirm -jar/' ${FTB_SERVER_START}
sed -i 's/.*read.*Restart now/#\0/' ${FTB_SERVER_START}
legacyJavaFixerPath=${FTB_DIR}/mods/legacyjavafixer.jar legacyJavaFixerPath=${FTB_DIR}/mods/legacyjavafixer.jar
if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e ${legacyJavaFixerPath} ]; then if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e ${legacyJavaFixerPath} ]; then