mirror of
https://github.com/CerberusV1/minecraft_deploy.git
synced 2026-01-13 11:24:04 +01:00
cleanup
This commit is contained in:
52
deploy.sh
52
deploy.sh
@@ -17,6 +17,9 @@ cat <<EOF
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# --------------------------------------------------------
|
||||||
|
# Checking Dependencies
|
||||||
|
# --------------------------------------------------------
|
||||||
read -p "Is java installed? (y/n): " answer
|
read -p "Is java installed? (y/n): " answer
|
||||||
if [ "$answer" == "n" ]; then
|
if [ "$answer" == "n" ]; then
|
||||||
echo "apt blah"
|
echo "apt blah"
|
||||||
@@ -68,27 +71,27 @@ select opt in "${versions[@]}"
|
|||||||
do
|
do
|
||||||
case $opt in
|
case $opt in
|
||||||
"1.21.1")
|
"1.21.1")
|
||||||
echo "Using Minecraft Version 1.21.1"
|
echo "Not Supported yet"
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
"1.21")
|
"1.21")
|
||||||
echo "Sie haben Option 2 gewählt"
|
echo "Not Supported yet"
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
"1.20.6")
|
"1.20.6")
|
||||||
echo "Sie haben Option 3 gewählt"
|
echo "Not Supported yet"
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
"1.20.4")
|
"1.20.4")
|
||||||
echo "Abbruch"
|
echo "Not Supported yet"
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
"1.20.3")
|
"1.20.3")
|
||||||
echo "Abbruch"
|
echo "Not Supported yet"
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
"1.20.2")
|
"1.20.2")
|
||||||
echo "Abbruch"
|
echo "Not Supported yet"
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
"1.20.1")
|
"1.20.1")
|
||||||
@@ -103,25 +106,35 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
echo "link with part1: $minecraft_version and part2: $forge_version"
|
|
||||||
# echo How much RAM do you want to use?
|
# echo How much RAM do you want to use?
|
||||||
# echo What mods do you want to use?
|
# echo What mods do you want to use?
|
||||||
# echo Which mods do you want to add?
|
# echo Which mods do you want to add?
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------------------------------
|
||||||
|
# Installation Misc
|
||||||
|
# --------------------------------------------------------
|
||||||
|
|
||||||
|
# Set Working Directory
|
||||||
working_dir="$HOME/minecraft_server"
|
working_dir="$HOME/minecraft_server"
|
||||||
mkdir ${working_dir}
|
|
||||||
cd ${working_dir}
|
|
||||||
|
|
||||||
|
|
||||||
|
# Connecting Versions
|
||||||
mc_forge_version="${minecraft_version}-${forge_version}"
|
mc_forge_version="${minecraft_version}-${forge_version}"
|
||||||
|
|
||||||
|
# Creating Installer-URL Template
|
||||||
URL="https://maven.minecraftforge.net/net/minecraftforge/forge/${mc_forge_version}/forge-${mc_forge_version}-installer.jar"
|
URL="https://maven.minecraftforge.net/net/minecraftforge/forge/${mc_forge_version}/forge-${mc_forge_version}-installer.jar"
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------------------------------
|
||||||
|
# Downloading Installer
|
||||||
|
# --------------------------------------------------------
|
||||||
|
|
||||||
echo "Downloading installer"
|
echo "Downloading installer...."
|
||||||
wget "$working_dir" -P "$URL" > /dev/null &
|
mkdir ${working_dir}
|
||||||
|
cd ${working_dir}
|
||||||
|
wget "$working_dir" "$URL" > /dev/null 2>&1 & # no output for wget
|
||||||
|
|
||||||
|
# Waiting for download to finish
|
||||||
PID=$!
|
PID=$!
|
||||||
(
|
(
|
||||||
while kill -0 $PID 2> /dev/null; do
|
while kill -0 $PID 2> /dev/null; do
|
||||||
@@ -131,7 +144,6 @@ PID=$!
|
|||||||
echo "Download finished."
|
echo "Download finished."
|
||||||
) &&
|
) &&
|
||||||
|
|
||||||
wait $PID
|
|
||||||
|
|
||||||
echo "Installing Server"
|
echo "Installing Server"
|
||||||
sleep 2
|
sleep 2
|
||||||
@@ -142,14 +154,12 @@ echo "Removing Installer"
|
|||||||
touch "${working_dir}/start_server.sh"
|
touch "${working_dir}/start_server.sh"
|
||||||
chmod +x "${working_dir}/start_server.sh"
|
chmod +x "${working_dir}/start_server.sh"
|
||||||
|
|
||||||
echo "#!/bin/bash"\
|
echo "Creating Start Script"
|
||||||
"tmux new-session -d -s mcServer '\
|
|
||||||
cd /pfad/zum/minecraft/server && \
|
#!/bin/bash
|
||||||
java -Xms4G -Xmx8G \
|
echo "#!/bin/bash" > "${working_dir}/start_server.sh"
|
||||||
-Djava.awt.headless=true \
|
echo "tmux new -s minecraft_server "java @user_jvm_args.txt @libraries/net/minecraftforge/forge/${mc_forge_version}/unix_args.txt '$@'"" >> "${working_dir}/start_server.sh"
|
||||||
@user_jvm_args.txt \
|
|
||||||
@libraries/net/minecraftforge/forge/\${mc_forge_version}/unix_args.txt \
|
|
||||||
\${mc_forge_version}'" >> "${working_dir}/start_server.sh"
|
|
||||||
|
|
||||||
# sh startServer.sh "${mc_forge_version}"
|
# sh startServer.sh "${mc_forge_version}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user