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

14 lines
421 B
Bash
Raw Normal View History

2021-02-19 20:11:08 +00:00
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"