Added support for "all" server name. Fixes #16.

Using "all" executes a command for all servers.
This commit is contained in:
Marcus Whybrow 2012-06-07 14:22:27 +01:00
parent de473cc75f
commit 9447124b58
2 changed files with 495 additions and 481 deletions

View File

@ -64,7 +64,7 @@ __init_server() {
_msm() {
__init
local base current options
COMPREPLY=()
@ -74,7 +74,7 @@ _msm() {
if [ -d "$SERVER_STORAGE_PATH" ]; then
local servers="$(ls -1 "$SERVER_STORAGE_PATH")"
fi
options="help start stop restart version server jargroup $servers"
options="help start stop restart version server jargroup all $servers"
else
case "${COMP_WORDS[1]}" in
stop|restart)
@ -112,7 +112,7 @@ _msm() {
# Server options
local server_path="$SERVER_STORAGE_PATH/${COMP_WORDS[1]}"
if [ -e "$server_path" ]; then
if [[ "${COMP_WORDS[1]}" == "all" ]] || [ -e "$server_path" ]; then
# If the server exists
__init_server "${COMP_WORDS[1]}"

970
init/msm

File diff suppressed because it is too large Load Diff