Added two scripts: Connect & Stop to Minecraft
This commit is contained in:
parent
4ce9c4031b
commit
769db18f35
17
CentOS/Minecraft/Minecraft-Connect-Server.bash
Executable file
17
CentOS/Minecraft/Minecraft-Connect-Server.bash
Executable 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 ${?}
|
20
CentOS/Minecraft/Minecraft-Stop-Server.bash
Executable file
20
CentOS/Minecraft/Minecraft-Stop-Server.bash
Executable 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 ${?}
|
Loading…
Reference in New Issue
Block a user