Added two scripts: Connect & Stop to Minecraft

This commit is contained in:
Price Hiller 2021-07-31 19:19:54 -05:00
parent 4ce9c4031b
commit 769db18f35
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#!/bin/bash --posix
set -e
usage() {
echo \
"Help Menu
Usage: $(basename ${0}) <server id>"
exit "${1}"
}
[[ -z "${1}" ]] && usage 1
[[ "${1}" == "--help" || "${1}" == "-h" ]] && usage 0
tmux attach-session -t "Minecraft-Server-${1}"
exit ${?}

View File

@ -0,0 +1,20 @@
#!/bin/bash
set -e
usage() {
echo \
"Help Menu
Usage: $(basename "${0}") <server id>"
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 ${?}