Will compile the server from source, this process may take some minutes.
Downlad latest BuildTools.jar
Download latest BuildTools.jar before updating the server.echo '#!/bin/bash
cd "`dirname \"$0\"`"
ARGS=""
while test $# -gt 0; do
case "$1" in
"-autoupdate")
AUTO_UPDATE="yes" ;;
"-updateBuildTools")
UPDBT="yes" ;;
*)
ARGS="$ARGS $1" ;;
esac
shift
done
# java -XX:+UseConcMarkSweepGC -Xmx1024M -XX:MaxPermSize=128M -jar spigot.jar nogui
RUNCMD="java$ARGS"
BTURL="https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar"
BT="BuildTools.jar"
if test -n "$UPDBT"; then
HEAD=$(curl -I "$BTURL" 2>/dev/null | head -n 1 | cut -d$" " -f2)
if [ "$HEAD" == "200" ]; then
rm -f "$BT"
echo "Downloading $BT from $BTURL, please wait"
curl -s "$BTURL" -o "$BT"
else
echo "Error: Unable to download $BT from $BTURL, Response: $HEAD"
fi
fi
if test -n "$AUTO_UPDATE"; then
if test -f "$BT"; then
echo "Buiding jar files"
java -jar "$BT"
mv spigot-*.jar spigot.jar
echo eula=true > eula.txt
else
echo "Error: $BT not found. "
if test -z "$UPDBT"; then
echo "Use -updateBuildTools to download it. "
fi
fi
fi
echo "Starting server with command: $RUNCMD"
$RUNCMD
exit $?' > spigot_run