32 lines
709 B
Plaintext
32 lines
709 B
Plaintext
# Create the directory
|
|
mkdir -p /home/yunohost.app/spigot
|
|
cd /home/yunohost.app/spigot
|
|
|
|
# Download the file
|
|
wget https://cdn.getbukkit.org/spigot/spigot-1.16.3.jar
|
|
mv spigot-1.16.3.jar server.jar
|
|
|
|
# Accept the eula
|
|
java -jar server.jar nogui
|
|
sed -i 's/eula=false/eula=true/g' eula.txt
|
|
|
|
# Create the systemd
|
|
rm /etc/systemd/system/spigot
|
|
echo """[Unit]
|
|
Description=spigot
|
|
After=network.target
|
|
|
|
[Service]
|
|
WorkingDirectory=/home/yunohost.app/spigot
|
|
User=root
|
|
Type=simple
|
|
ExecStart=/usr/bin/java -Xmx1024M -Xms1024M -jar server.jar nogui
|
|
Restart=always
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target""" >> /etc/systemd/system/spigot.service
|
|
|
|
# Run the app and enable systemd
|
|
systemctl start spigot
|
|
systemctl enable spigot
|