[Tutorial] Restartscript for any modpack in linux

  • FTB will be shutting down this forum by the end of July. To participate in our community discussions, please join our Discord! https://ftb.team/discord

rexlManu

New Member
Jun 13, 2020
3
1
4
It can often be very annoying when the server crashes and then won't start anymore.
Therefore I show you how to use the restart script and how to adapt it to your needs

First at all create a file with the name like start.sh with the following content:

Bash:
#!/bin/bash
echo "Restart Script"
while :
do
    echo "Press [CTRL+C] to stop..."
    sleep 1
    java -server -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -Xmx4096M -Xms128M -jar forge.jar nogui
done
echo "Exit out of restart script"
You can change the (-Xmx)4096M to your choice of ram. The M after the number stands for mb, so 4096 is identical to 4GB of ram.
The same thing for -Xms128M.

It is best to change your start jar to forge.jar or change forge.jar to your jar name.

Thats it, give the script enough rights (chmod 755 start.sh).

Then start it in a screen with the following command:
screen -amdS <your name of choice> ./start.sh

I hope this little tutorial helps you and I apologize for the bad grammar.