diff --git a/CentOS/Minecraft/Minecraft-Connect-Server.bash b/CentOS/Minecraft/Minecraft-Connect-Server.bash new file mode 100755 index 0000000..050bcac --- /dev/null +++ b/CentOS/Minecraft/Minecraft-Connect-Server.bash @@ -0,0 +1,17 @@ +#!/bin/bash --posix + +set -e + +usage() { + echo \ + "Help Menu + Usage: $(basename ${0}) " + exit "${1}" +} + +[[ -z "${1}" ]] && usage 1 +[[ "${1}" == "--help" || "${1}" == "-h" ]] && usage 0 + +tmux attach-session -t "Minecraft-Server-${1}" + +exit ${?} diff --git a/CentOS/Minecraft/Minecraft-Stop-Server.bash b/CentOS/Minecraft/Minecraft-Stop-Server.bash new file mode 100755 index 0000000..b5a41fb --- /dev/null +++ b/CentOS/Minecraft/Minecraft-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 "Minecraft-Server-${1}" "C-c" ENTER > /dev/null 2>&1 \ + && echo "Stopped Minecraft-Server-${1}" \ + || echo "Could not find Minecraft-Server-${1}" + +exit ${?} \ No newline at end of file