For this script to work you need a “version.txt” file in the same folder as the script. The file has to contain your current server version(1.12.1).

NEWVERSION=$(curl -s '' | python3 -c "import sys, json; print(json.load(sys.stdin)['latest']['release'])")
    if [ $NEWVERSION != $(cat version.txt) ]; then
       echo $NEWVERSION > version.txt
       wget ''$NEWVERSION'/minecraft_server.'$NEWVERSION'.jar'
       ps aux | grep -i minecraft_server | awk {'print $2'} | xargs kill -9
       nohup java -Xmx1324M -Xms1324M -jar 'minecraft_server.'$NEWVERSION'.jar' &
⤧  Previous post Send Emails from the Command-line