moving fast before testing
This commit is contained in:
parent
6d9c423ab7
commit
33b9bbc76f
@ -8,15 +8,7 @@ WantedBy=multi-user.target
|
||||
[Service]
|
||||
ExecReload=/usr/bin/screen -S minecraft -X stuff \"reload^M\"
|
||||
|
||||
ExecStart=/usr/bin/screen -DmS minecraft ./run.sh
|
||||
|
||||
#ExecStartPre=/bin/sh -c '/usr/bin/screen -dmS mc-perfect'
|
||||
#ExecStart=/bin/sh -c '/opt/minecraft/run.sh'
|
||||
|
||||
#ExecStop=/usr/bin/screen -S minecraft -X stuff \"save-all^M\"
|
||||
#ExecStop=/bin/sleep 5
|
||||
#ExecStop=/usr/bin/screen -S minecraft -X stuff \"stop^M\"
|
||||
#ExecStop=/bin/sleep 5
|
||||
ExecStart=/usr/bin/screen -DmS minecraft ./start.sh
|
||||
|
||||
ExecStop=/usr/bin/screen -p 0 -S minecraft -X eval 'stuff "say SERVER SHUTTING DOWN. Saving map..."\\015'
|
||||
ExecStop=/bin/sh -c '/bin/sleep 5'
|
||||
@ -24,8 +16,8 @@ ExecStop=/usr/bin/screen -p 0 -S minecraft -X eval 'stuff "save-all"\\015'
|
||||
ExecStop=/usr/bin/screen -p 0 -S minecraft -X eval 'stuff "stop"\\015'
|
||||
ExecStop=/bin/sh -c '/bin/sleep 10'
|
||||
|
||||
#Restart=on-failure
|
||||
#RestartSec=60s
|
||||
Restart=on-failure
|
||||
RestartSec=60s
|
||||
|
||||
ProtectControlGroups=true
|
||||
ProtectHome=true
|
||||
@ -1,9 +0,0 @@
|
||||
# Xmx and Xms set the maximum and minimum RAM usage, respectively.
|
||||
# They can take any number, followed by an M or a G.
|
||||
# M means Megabyte, G means Gigabyte.
|
||||
# For example, to set the maximum to 3GB: -Xmx3G
|
||||
# To set the minimum to 2.5GB: -Xms2500M
|
||||
|
||||
# A good default for a modded server is 4GB.
|
||||
# Uncomment the next line to set it.
|
||||
# -Xmx4G
|
||||
34
script.sh
34
script.sh
@ -68,6 +68,7 @@ fi
|
||||
|
||||
# User and groupe managment
|
||||
printf "\n+ Creating user minecraft and basic file structure"
|
||||
|
||||
groupadd minecraft
|
||||
|
||||
useradd --system --shell /usr/sbin/nologin --home /opt/minecraft -g minecraft minecraft
|
||||
@ -75,28 +76,30 @@ useradd --system --shell /usr/sbin/nologin --home /opt/minecraft -g minecraft mi
|
||||
# File strukture and basic install
|
||||
mkdir /opt/minecraft
|
||||
|
||||
mv data/Forge-1.20.1.jar /opt/minecraft/
|
||||
mv data/paper-1.20.6-148.jar /opt/minecraft/
|
||||
|
||||
cd /opt/minecraft/
|
||||
|
||||
# Installing server
|
||||
printf "+ Installing Forge 1.20.1 \n \n"
|
||||
printf "+ Installing Paper 1.20.6 \n \n"
|
||||
|
||||
java -Xms512M -Xmx2048M -jar Forge-1.20.1.jar --installServer
|
||||
java -Xms512M -Xmx2048M -jar paper-1.20.6-148.jar --nogui
|
||||
|
||||
cd -
|
||||
|
||||
cd data/
|
||||
mv eula.txt server-icon.png server.properties run.sh user_jvm_args.txt /opt/minecraft/
|
||||
mv eula.txt server-icon.png server.properties user_jvm_args.txt /opt/minecraft/
|
||||
cd ..
|
||||
|
||||
mkdir /opt/minecraft/mods
|
||||
### Addons support???
|
||||
|
||||
printf "\n+ Unpacking mods \n \n"
|
||||
# mkdir /opt/minecraft/mods
|
||||
|
||||
cd data
|
||||
7z x Mods.zip -o/opt/minecraft/mods/
|
||||
cd ..
|
||||
# printf "\n+ Unpacking mods \n \n"
|
||||
|
||||
# cd data
|
||||
# 7z x Mods.zip -o/opt/minecraft/mods/
|
||||
# cd ..
|
||||
|
||||
# Permision handeling
|
||||
printf "\n+ Permision handeling\n"
|
||||
@ -104,11 +107,11 @@ chown -R minecraft:minecraft /opt/minecraft
|
||||
|
||||
# SystemD service
|
||||
printf "+ Preparign systemD service\n"
|
||||
mv data/mc-forge.service /etc/systemd/system/
|
||||
mv data/mc-paper.service /etc/systemd/system/
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl start mc-forge.service
|
||||
systemctl enable mc-forge
|
||||
systemctl start mc-paper
|
||||
systemctl enable mc-paper
|
||||
|
||||
|
||||
# integration of Maxopoly's instructions on firewall
|
||||
@ -140,15 +143,16 @@ if [[ "$ansFirewallSetup" =~ ("Y"|"y") || -z "$ansFirewallSetup" ]]; then
|
||||
|
||||
iptables -P OUTPUT ACCEPT #Allow all outgouing
|
||||
|
||||
sudo apt install iptables-persistent -y
|
||||
|
||||
|
||||
else
|
||||
|
||||
printf "\nOK it is time for manual configuration"
|
||||
printf "\nAfter you are done ramamber to run 'apt install iptables-persistent' to save your config. System will automaticly remove your work after restart"
|
||||
printf "\nAfter you are done ramamber to run 'apt install iptables-persistent' to save your config. System will automaticly remove your work after restart \n \n"
|
||||
|
||||
fi
|
||||
|
||||
apt install iptables-persistent -y
|
||||
|
||||
fi
|
||||
|
||||
printf "\n+ Done, thanks for your time. It is goode idea to chack if everythink is alright by running:"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user