This repository has been archived on 2023-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
McGamerZone/scripts/stopServer.sh
2021-02-19 15:11:08 -05:00

14 lines
421 B
Bash

serverGroup=$1
serverId=$2
logsDirectory=/home/minecraft/serverLogs/$serverGroup
# Create the group logs directory if the directory doesn't exist
mkdir -p "$logsDirectory"
cp /home/minecraft/servers/$serverGroup/$serverId/logs/latest.log "$logsDirectory"/"$serverId-$(date +"%Y_%m_%d_%I_%M_%p").log"
screen -S minecraftServer-"$serverId" -X kill
screen -S minecraftServer-"$serverId" -X quit
rm -r "$serverDirectory"