28 lines
1.3 KiB
Makefile
28 lines
1.3 KiB
Makefile
.PHONY: local-clean-cache
|
|
local-clean-cache:
|
|
rm -rf $(find -type d -name 'cache')
|
|
rm -rf $(find -type d -name 'logs')
|
|
rm -rf ./proxy/anvil
|
|
|
|
.PHONY: upgrade-remote
|
|
upgrade-servers: local-clean-cache
|
|
ssh koala -t "systemctl list-units --type=service --state=running | grep 'Minecraft Server' | awk '{print $1}' | xargs systemctl stop"
|
|
rsync -avH ./servers -e ssh root@koala.vxm.cz:/opt/minecraft
|
|
ssh koala -t "chown -R minecraft:minecraft /opt/minecraft/servers"
|
|
ssh koala -t "systemctl list-units --type=service --state=stopped | grep 'Minecraft Server' | awk '{print $1}' | xargs systemctl start"
|
|
|
|
.PHONY: upgrade-proxy
|
|
upgrade-proxy: local-clean-cache
|
|
ssh koala -t "systemctl stop velocity"
|
|
rsync -avH ./proxy -e ssh root@koala.vxm.cz:/opt/minecraft
|
|
ssh koala -t "chown -R minecraft:minecraft /opt/minecraft/proxy"
|
|
ssh koala -t "systemctl start velocity"
|
|
|
|
.PHONY: upgrade-systemd
|
|
upgrade-systemd:
|
|
ssh koala -t "systemctl list-units --type=service --state=running | grep 'Minecraft Server' | awk '{print $1}' | xargs systemctl stop"
|
|
ssh koala -t "systemctl stop velocity"
|
|
rsync -avH ./.systemd/* -e ssh root@koala.vxm.cz:/etc/systemd/system/
|
|
systemctl daemon-reload
|
|
ssh koala -t "systemctl list-units --type=service --state=stopped | grep 'Minecraft Server' | awk '{print $1}' | xargs systemctl start"
|
|
ssh koala -t "systemctl start velocity"
|