From bf811c226d4dc4290cba888d215a629131325f38 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Wed, 4 Aug 2021 00:48:34 -0500 Subject: [PATCH] Update MC Readme, add Squad-Stop-Server.bash --- CentOS/Minecraft/README.md | 4 ++-- CentOS/Squad/Squad-Stop-Server.bash | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 CentOS/Squad/Squad-Stop-Server.bash diff --git a/CentOS/Minecraft/README.md b/CentOS/Minecraft/README.md index 61a5384..7bf55d5 100644 --- a/CentOS/Minecraft/README.md +++ b/CentOS/Minecraft/README.md @@ -43,8 +43,8 @@ server directory/backups. e.g. `~/Minecraft/Server-1/backups/` - Corresponds with the server in ~/Minecraft where the ID is the number in the directory name - `-r` | `--rcon-ignore` - This flag will ensure that Minecraft's rcon password is not overwritten by the script - - `-j` | `--jar` - - Path to a minecraft server jar and the server will install that jar to the given ID + - `-i` | `--install` + - Takes in a spigot revision or just "latest", see https://www.spigotmc.org/wiki/buildtools/ for revisions ## Minecraft-Connect-Server Used to connect to a running Minecraft server's console to see log output or kill the server with ^C (control + c) diff --git a/CentOS/Squad/Squad-Stop-Server.bash b/CentOS/Squad/Squad-Stop-Server.bash new file mode 100755 index 0000000..69e0eac --- /dev/null +++ b/CentOS/Squad/Squad-Stop-Server.bash @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e + +usage() { + echo \ +"Help Menu + Usage: $(basename "${0}") " + exit "${1}" +} + + +[[ -z "${1}" ]] && usage 1 +[[ "${1}" == "--help" || "${1}" == "-h" ]] && usage 0 + +tmux send-keys -t "Squad-Server-${1}" "C-c" ENTER > /dev/null 2>&1 \ + && echo "Stopped Squad-Server-${1}" \ + || echo "Could not find Squad-Server-${1}" + +exit ${?} \ No newline at end of file