Created
March 25, 2022 21:20
-
-
Save EnderGamingFilms/e033aede3fea9cedd4b9df1925cfdff1 to your computer and use it in GitHub Desktop.
Minecraft Server Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
JAR=server.jar | |
MAX=6144M | |
MIN=512M | |
while getopts ":j:x:s" opt; do | |
case $opt in | |
j) | |
JAR=${OPTARG} | |
;; | |
x) | |
MAX=${OPTARG}M | |
;; | |
s) | |
MIN=${OPTARG}M | |
;; | |
\?) | |
echo "Invalid option: -$OPTARG" >&2 | |
exit 0 | |
esac | |
done | |
echo Using jar $JAR with $MAX of memory; | |
while true; do | |
java -DIReallyKnowWhatIAmDoingThisUpdate=true -Xms${MIN} -Xmx${MAX} -jar ${JAR} -o true nogui | |
echo 'Restarting server in 5s... (Precc ctrl+c to cancel)' | |
sleep 5s | |
echo 'Server Restarting!' | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo 'Starting server...' | |
screen -S "Server" -U -m -d bash start-server.sh -j paper.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment