Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions ServerStart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ install_server(){
export MC_SERVER_URL="${MC_SERVER_FORGEURL}"
fi

command - v curl >> /dev/null 2>&1
command -v curl >> /dev/null 2>&1
if [[ $? == 0 ]]; then
echo "DEBUG: (curl) Downloading ${MC_SERVER_URL}" >>logs/serverstart.log 2>&1
curl -OJL "${MC_SERVER_URL}" >>logs/serverstart.log 2>&1
Expand Down Expand Up @@ -378,13 +378,18 @@ while $run ; do
echo "Required files not found, need to install Forge"
install_server
fi
forge=$(ls forge*"$MC_SERVER_MCVER"*"$MC_SERVER_FORGEVER"*universal.jar 2>>logs/serverstart.log)
if [[ $? != 0 ]] ; then
forge=("$(ls forge*"$MC_SERVER_MCVER"*"$MC_SERVER_FORGEVER"*.jar)") 2>>logs/serverstart.log 2>&1
for file in ${forge[0]}; do
if [[ "$file" != *"installer"* ]]; then
export MC_SERVER_FORGE_JAR="${file}"
break
fi
done
if [[ -z $MC_SERVER_FORGE_JAR ]] ; then
echo "WARN: no forge jar for MCVER: $MC_SERVER_MCVER and FORGEVER: $MC_SERVER_FORGEVER found" >>logs/serverstart.log
echo "Required files not found, need to install Forge"
install_server
else
export MC_SERVER_FORGE_JAR="${forge[0]}"
echo "DEBUG: Found forge jar: $MC_SERVER_FORGE_JAR" >>logs/serverstart.log
fi

Expand Down