With this script you can restart your server if it crashes or use a plugin that automatically closes the server (e.g. UltimateAutoRestart)
Check if you have Screen installed on your machine
- Go to the server folder
- Paste the script into it
- Change the values according to your needs
- Run this command chmod +700 *.sh
- Run ./start.sh
- Now you can connect to the screen with screen -x ServerName
- Go to the server folder
- Paste the script into it
- Change the values according to your needs
- Run the script
Simply run sed -i -e 's/\r$//' file.sh
The ^M is a carriage return character. Linux uses the line feed character to mark the end of a line, whereas Windows uses the two-character sequence CR LF. Your file has Windows line endings, which is confusing Linux.
If you still have problems with the script contact me on Discord