mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
Added support for "all" server name. Fixes #16.
Using "all" executes a command for all servers.
This commit is contained in:
@ -64,7 +64,7 @@ __init_server() {
|
|||||||
|
|
||||||
_msm() {
|
_msm() {
|
||||||
__init
|
__init
|
||||||
|
|
||||||
local base current options
|
local base current options
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ _msm() {
|
|||||||
if [ -d "$SERVER_STORAGE_PATH" ]; then
|
if [ -d "$SERVER_STORAGE_PATH" ]; then
|
||||||
local servers="$(ls -1 "$SERVER_STORAGE_PATH")"
|
local servers="$(ls -1 "$SERVER_STORAGE_PATH")"
|
||||||
fi
|
fi
|
||||||
options="help start stop restart version server jargroup $servers"
|
options="help start stop restart version server jargroup all $servers"
|
||||||
else
|
else
|
||||||
case "${COMP_WORDS[1]}" in
|
case "${COMP_WORDS[1]}" in
|
||||||
stop|restart)
|
stop|restart)
|
||||||
@ -112,7 +112,7 @@ _msm() {
|
|||||||
# Server options
|
# Server options
|
||||||
|
|
||||||
local server_path="$SERVER_STORAGE_PATH/${COMP_WORDS[1]}"
|
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
|
# If the server exists
|
||||||
|
|
||||||
__init_server "${COMP_WORDS[1]}"
|
__init_server "${COMP_WORDS[1]}"
|
||||||
|
Reference in New Issue
Block a user