Antares-Network / BASM

Bungee Automatic Server Manager is a BungeeCord plugin that allows a server owner to allow for private proxied servers to be created by players.
https://playantares.com
Other
3 stars 0 forks source link

Updates to the start.sh scripts for sub servers #4

Open nathen418 opened 3 years ago

nathen418 commented 3 years ago

add a rsync line to the start script for the sub server templates. This would be an easy way to update the plugin jars of each sub server before it starts every time. This can also be used to keep the server jar up to date with a wget call to the paper API or another rsync line to sync the server jars. This is not a good solution in the long term as this will cause lots of writes to the drive. A better solution would be to look at a jar downloaded in the past week and compare it to the md5 checksum of the jar currently in the sub server folder.

#1/bin/bash
echo "syncing plugin folder"
rsync -aP --delete {template_path}/plugins/ {server_path}/plugins/
echo "Syncing server jar"
rsync -aP --delete {latest_server_jar_path}/ {server_path}/

echo "Starting server screen"
screen -d -m -S {server_name_here} bash -c 'java -jar paper_latest.jar'
echo "Screen Started"
nathen418 commented 3 years ago

this will work in the short term but eventually, I want to do this thru java and have it be configurable for each server or something. Or just have it toggleable to update all the jars at once instead of on each server's boot. There could also be some flag set in the server dictionary that excludes server jar or plugin jar updating