2025-03-10 03:19:41 -04:00

21 lines
336 B
Bash
Executable File

#!/bin/sh
server_dir="/home/bryan/roommates-mc"
# Check if the server is online
mcrcon help >/dev/null 2>&1
rcon_ping="$?"
set -e
if [ $rcon_ping = 0 ]; then
mcrcon save-off
mcrcon "save-all flush"
fi
git -C $server_dir add -A || true
git -C $server_dir commit -m "Changes" || true
if [ $rcon_ping = 0 ]; then
mcrcon save-on
fi