it works!
This commit is contained in:
parent
3fbcabaa63
commit
7074706667
15
script.sh
15
script.sh
@ -12,17 +12,21 @@ sudo apt install openjdk-17-jre-headless screen p7zip-full iptables -y
|
||||
# User and groupe managment
|
||||
groupadd minecraft
|
||||
|
||||
useradd --system --shell /usr/sbin/nologin --home /opt/minecraft -g minecraft minecraf
|
||||
useradd --system --shell /usr/sbin/nologin --home /opt/minecraft -g minecraft minecraft
|
||||
|
||||
# File strukture and basic install
|
||||
mkdir /opt/minecraft
|
||||
|
||||
mv Forge-1.20.1.jar /opt/minecraft/
|
||||
|
||||
### Husten we have a problem
|
||||
cd /opt/minecraft/
|
||||
|
||||
# Installing server
|
||||
java -Xms512M -Xmx2048M -jar Forge-1.20.1.jar --installServer
|
||||
|
||||
/bin/sleep 30
|
||||
/bin/sleep 10
|
||||
|
||||
cd -
|
||||
|
||||
# /opt/minecraft/run.sh # it may needs to run before copying eula. But I dont want to mess with timing
|
||||
|
||||
@ -52,10 +56,13 @@ chown -R minecraft:minecraft /opt/minecraft
|
||||
# SystemD service
|
||||
cp mc-forge.service /etc/systemd/system/
|
||||
|
||||
systemctl enable mc-forge
|
||||
systemctl daemon-reload
|
||||
|
||||
systemctl start mc-forge.service
|
||||
|
||||
systemctl enable mc-forge
|
||||
|
||||
|
||||
# ipTable script integration
|
||||
iptables -P INPUT ACCEPT #Clears existing rules
|
||||
iptables -A INPUT -i lo -j ACCEPT #Allow loopback
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user