mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
Added specific helpful error messages for commands. Closes #10.
This commit is contained in:
parent
f41216d5dd
commit
3078840d8f
190
init/msm
190
init/msm
@ -96,7 +96,7 @@ error_exit() {
|
|||||||
CONF_ERROR) code=73;;
|
CONF_ERROR) code=73;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "$(basename $0) Error $1 ($code): ${2:-"Unknown Error"}" 1>&2
|
echo "${2:-"Unknown Error"}" 1>&2
|
||||||
exit "${code:-$1}"
|
exit "${code:-$1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1586,7 +1586,7 @@ main() {
|
|||||||
create)
|
create)
|
||||||
if [ -z "$3" ]; then
|
if [ -z "$3" ]; then
|
||||||
# If a server name is not provided
|
# If a server name is not provided
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 server create <server-name>"
|
||||||
else
|
else
|
||||||
# Create a new server
|
# Create a new server
|
||||||
server_create "$3"
|
server_create "$3"
|
||||||
@ -1595,7 +1595,7 @@ main() {
|
|||||||
delete)
|
delete)
|
||||||
if [ -z "$3" ]; then
|
if [ -z "$3" ]; then
|
||||||
# If a server name is not provided
|
# If a server name is not provided
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 server delete <server-name>"
|
||||||
else
|
else
|
||||||
# Delete an existing server, with confirmation
|
# Delete an existing server, with confirmation
|
||||||
server_delete "$3"
|
server_delete "$3"
|
||||||
@ -1604,7 +1604,7 @@ main() {
|
|||||||
rename)
|
rename)
|
||||||
if [ -z "$3" ] || [ -z "$4" ]; then
|
if [ -z "$3" ] || [ -z "$4" ]; then
|
||||||
# If a server name is not provided
|
# If a server name is not provided
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 server rename <original-name> <new-name>"
|
||||||
else
|
else
|
||||||
# Rename an existing server
|
# Rename an existing server
|
||||||
server_rename "$3" "$4"
|
server_rename "$3" "$4"
|
||||||
@ -1612,7 +1612,7 @@ main() {
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# "server" is not a valid command
|
# "server" is not a valid command
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 server list|create|delete|rename"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -1624,14 +1624,14 @@ main() {
|
|||||||
;;
|
;;
|
||||||
create)
|
create)
|
||||||
if [ -z "$3" ] || [ -z "$4" ]; then
|
if [ -z "$3" ] || [ -z "$4" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 jargroup create <jargroup-name> <download-url>"
|
||||||
else
|
else
|
||||||
jargroup_create "$3" "$4"
|
jargroup_create "$3" "$4"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
delete)
|
delete)
|
||||||
if [ -z "$3" ]; then
|
if [ -z "$3" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 jargroup delete <jargroup-name>"
|
||||||
else
|
else
|
||||||
jargroup_delete "$3"
|
jargroup_delete "$3"
|
||||||
fi
|
fi
|
||||||
@ -1639,28 +1639,28 @@ main() {
|
|||||||
;;
|
;;
|
||||||
rename)
|
rename)
|
||||||
if [ -z "$3" ] || [ -z "$4" ]; then
|
if [ -z "$3" ] || [ -z "$4" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 jargroup rename <original-name> <new-name>"
|
||||||
else
|
else
|
||||||
jargroup_rename "$3" "$4"
|
jargroup_rename "$3" "$4"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
changetarget)
|
changetarget)
|
||||||
if [ -z "$3" ] || [ -z "$4" ]; then
|
if [ -z "$3" ] || [ -z "$4" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 jargroup changetarget <jargroup-name> <new-download-url>"
|
||||||
else
|
else
|
||||||
jargroup_settarget "$3" "$4"
|
jargroup_settarget "$3" "$4"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
getlatest)
|
getlatest)
|
||||||
if [ -z "$3" ]; then
|
if [ -z "$3" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 jargroup getlatest <jargroup-name>"
|
||||||
else
|
else
|
||||||
jargroup_getlatest "$3"
|
jargroup_getlatest "$3"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# "jargroup" is not a valid command
|
# "jargroup" is not a valid command
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 jargroup list|create|delete|rename|changetarget|getlatest"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -1724,7 +1724,7 @@ main() {
|
|||||||
echo -e " version Prints the Minecraft Server Manager version installed8"
|
echo -e " version Prints the Minecraft Server Manager version installed8"
|
||||||
;;
|
;;
|
||||||
"")
|
"")
|
||||||
echo "No such command see: $0 help"
|
error_exit INVALID_COMMAND "No such command see: $0 help"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [[ "$1" == "all" ]] || [[ -d "$SERVER_STORAGE_PATH/$1" ]]; then
|
if [[ "$1" == "all" ]] || [[ -d "$SERVER_STORAGE_PATH/$1" ]]; then
|
||||||
@ -1776,7 +1776,7 @@ main() {
|
|||||||
;;
|
;;
|
||||||
ram)
|
ram)
|
||||||
if [ -z "$4" ]; then
|
if [ -z "$4" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> worlds ram <world-name>"
|
||||||
else
|
else
|
||||||
world_id="$(server_world_get_id "$id" "$4")"
|
world_id="$(server_world_get_id "$id" "$4")"
|
||||||
|
|
||||||
@ -1812,20 +1812,20 @@ main() {
|
|||||||
;;
|
;;
|
||||||
on)
|
on)
|
||||||
if [ -z "$4" ]; then
|
if [ -z "$4" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> worlds on <world-name>"
|
||||||
else
|
else
|
||||||
world_activate "$(server_world_get_id "$id" "$4")"
|
world_activate "$(server_world_get_id "$id" "$4")"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
off)
|
off)
|
||||||
if [ -z "$4" ]; then
|
if [ -z "$4" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> worlds off <world-name>"
|
||||||
else
|
else
|
||||||
world_deactivate "$(server_world_get_id "$id" "$4")"
|
world_deactivate "$(server_world_get_id "$id" "$4")"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> worlds list|load|ram|todisk|backup|on|off"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -1851,7 +1851,7 @@ main() {
|
|||||||
;;
|
;;
|
||||||
jar)
|
jar)
|
||||||
if [ -z "$3" ]; then
|
if [ -z "$3" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> jar <jargroup-name> [jar-file-name]"
|
||||||
else
|
else
|
||||||
server_set_jar "$id" "$3" "$4"
|
server_set_jar "$id" "$3" "$4"
|
||||||
fi
|
fi
|
||||||
@ -1876,7 +1876,7 @@ main() {
|
|||||||
;;
|
;;
|
||||||
add)
|
add)
|
||||||
if [ -z "$4" ]; then
|
if [ -z "$4" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> whitelist add <player-name>"
|
||||||
else
|
else
|
||||||
if server_is_running "$id"; then
|
if server_is_running "$id"; then
|
||||||
server_eval "$id" "whitelist add $4"
|
server_eval "$id" "whitelist add $4"
|
||||||
@ -1888,7 +1888,7 @@ main() {
|
|||||||
;;
|
;;
|
||||||
remove)
|
remove)
|
||||||
if [ -z "$4" ]; then
|
if [ -z "$4" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> whitelist remove <player-name>"
|
||||||
else
|
else
|
||||||
if server_is_running "$id"; then
|
if server_is_running "$id"; then
|
||||||
server_eval "$id" "whitelist remove $4"
|
server_eval "$id" "whitelist remove $4"
|
||||||
@ -1908,18 +1908,18 @@ main() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> whitelist on|off|add|remove|list"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
blacklist|bl)
|
blacklist|bl)
|
||||||
case "$3" in
|
case "$3" in
|
||||||
player)
|
player)
|
||||||
if [ -z "$5" ]; then
|
case "$4" in
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
add)
|
||||||
else
|
if [ -z "$5" ]; then
|
||||||
case "$4" in
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> blacklist player add <player-name>"
|
||||||
add)
|
else
|
||||||
for player in ${*:5}; do
|
for player in ${*:5}; do
|
||||||
server_eval "$id" "ban $player"
|
server_eval "$id" "ban $player"
|
||||||
done
|
done
|
||||||
@ -1933,8 +1933,12 @@ main() {
|
|||||||
else
|
else
|
||||||
echo "Blacklisted \"$5\"."
|
echo "Blacklisted \"$5\"."
|
||||||
fi
|
fi
|
||||||
;;
|
fi
|
||||||
remove)
|
;;
|
||||||
|
remove)
|
||||||
|
if [ -z "$5" ]; then
|
||||||
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> blacklist player remove <player-name>"
|
||||||
|
else
|
||||||
for player in ${*:5}; do
|
for player in ${*:5}; do
|
||||||
server_eval "$id" "pardon $player"
|
server_eval "$id" "pardon $player"
|
||||||
done
|
done
|
||||||
@ -1948,47 +1952,55 @@ main() {
|
|||||||
else
|
else
|
||||||
echo "Removed \"$5\" from the blacklist."
|
echo "Removed \"$5\" from the blacklist."
|
||||||
fi
|
fi
|
||||||
;;
|
fi
|
||||||
*)
|
;;
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
*)
|
||||||
;;
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> blacklist player add|remove"
|
||||||
esac
|
;;
|
||||||
fi
|
esac
|
||||||
;;
|
;;
|
||||||
ip)
|
ip)
|
||||||
case "$4" in
|
case "$4" in
|
||||||
add)
|
add)
|
||||||
for address in ${*:5}; do
|
if [ -z "$5" ]; then
|
||||||
server_eval "$id" "ban-ip $address"
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> blacklist ip add <ip-address>"
|
||||||
done
|
|
||||||
if [[ $# > 5 ]]; then
|
|
||||||
echo -n "Blacklisted the following ip addresses: "
|
|
||||||
echo -n "$5"
|
|
||||||
for player in ${*:6}; do
|
|
||||||
echo -n ", $address"
|
|
||||||
done
|
|
||||||
echo "."
|
|
||||||
else
|
else
|
||||||
echo "Blacklisted \"$5\"."
|
for address in ${*:5}; do
|
||||||
|
server_eval "$id" "ban-ip $address"
|
||||||
|
done
|
||||||
|
if [[ $# > 5 ]]; then
|
||||||
|
echo -n "Blacklisted the following ip addresses: "
|
||||||
|
echo -n "$5"
|
||||||
|
for player in ${*:6}; do
|
||||||
|
echo -n ", $address"
|
||||||
|
done
|
||||||
|
echo "."
|
||||||
|
else
|
||||||
|
echo "Blacklisted \"$5\"."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
remove)
|
remove)
|
||||||
for address in ${*:5}; do
|
if [ -z "$5" ]; then
|
||||||
server_eval "$id" "pardon-ip $address"
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> blacklist ip remove <ip-address>"
|
||||||
done
|
|
||||||
if [[ $# > 5 ]]; then
|
|
||||||
echo -n "Removed the following ip addresses from the blacklist: "
|
|
||||||
echo -n "$5"
|
|
||||||
for player in ${*:6}; do
|
|
||||||
echo -n ", $address"
|
|
||||||
done
|
|
||||||
echo "."
|
|
||||||
else
|
else
|
||||||
echo "Removed \"$5\" from the ip blacklist."
|
for address in ${*:5}; do
|
||||||
|
server_eval "$id" "pardon-ip $address"
|
||||||
|
done
|
||||||
|
if [[ $# > 5 ]]; then
|
||||||
|
echo -n "Removed the following ip addresses from the blacklist: "
|
||||||
|
echo -n "$5"
|
||||||
|
for player in ${*:6}; do
|
||||||
|
echo -n ", $address"
|
||||||
|
done
|
||||||
|
echo "."
|
||||||
|
else
|
||||||
|
echo "Removed \"$5\" from the ip blacklist."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> blacklist ip add|remove"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -2016,26 +2028,34 @@ main() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> blacklist ip player|ip|list"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
operator|op)
|
operator|op)
|
||||||
case "$3" in
|
case "$3" in
|
||||||
add)
|
add)
|
||||||
if server_is_running "$id"; then
|
if [ -z "$4" ]; then
|
||||||
server_eval "$id" "op $4"
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> operator add <player-name>"
|
||||||
echo "The player \"$4\" is now an operator for the server."
|
|
||||||
else
|
else
|
||||||
error_exit SERVER_STOPPED "Server \"${server_name[$id]}\" is not running."
|
if server_is_running "$id"; then
|
||||||
|
server_eval "$id" "op $4"
|
||||||
|
echo "The player \"$4\" is now an operator for the server."
|
||||||
|
else
|
||||||
|
error_exit SERVER_STOPPED "Server \"${server_name[$id]}\" is not running."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
remove)
|
remove)
|
||||||
if server_is_running "$id"; then
|
if [ -z "$4" ]; then
|
||||||
server_eval "$id" "deop $4"
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> operator remove <player-name>"
|
||||||
echo "The player \"$4\" is no longer an operator for the server."
|
|
||||||
else
|
else
|
||||||
error_exit SERVER_STOPPED "Server \"${server_name[$id]}\" is not running."
|
if server_is_running "$id"; then
|
||||||
|
server_eval "$id" "deop $4"
|
||||||
|
echo "The player \"$4\" is no longer an operator for the server."
|
||||||
|
else
|
||||||
|
error_exit SERVER_STOPPED "Server \"${server_name[$id]}\" is not running."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
list)
|
list)
|
||||||
@ -2048,7 +2068,7 @@ main() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> operator add|remove|list"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -2056,13 +2076,13 @@ main() {
|
|||||||
case "$3" in
|
case "$3" in
|
||||||
survival|creative|0|1)
|
survival|creative|0|1)
|
||||||
if [ -z "$4" ]; then
|
if [ -z "$4" ]; then
|
||||||
echo "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> gamemode survival|creative <player-name>"
|
||||||
else
|
else
|
||||||
if server_is_running "$id"; then
|
if server_is_running "$id"; then
|
||||||
case "$3" in
|
case "$3" in
|
||||||
creative|1) local mode=1;;
|
creative|1) local mode=1;;
|
||||||
survival|0) local mode=0;;
|
survival|0) local mode=0;;
|
||||||
*) error_exit INVALID_COMMAND "Invalid mode";;
|
*) error_exit INVALID_ARGUMENT "Invalid gamemode type \"$3\" options are \"survival\", \"creative\", \"0\" or \"1\".";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
local line="$(server_eval_and_get_line "$id" "gamemode $4 $mode" "${server_confirm_gamemode[$id]}" "${server_confirm_gamemode_fail_no_user[$id]}" "${server_confirm_gamemode_fail_no_change[$id]}")"
|
local line="$(server_eval_and_get_line "$id" "gamemode $4 $mode" "${server_confirm_gamemode[$id]}" "${server_confirm_gamemode_fail_no_user[$id]}" "${server_confirm_gamemode_fail_no_change[$id]}")"
|
||||||
@ -2085,13 +2105,13 @@ main() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> gamemode survival|creative"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
kick)
|
kick)
|
||||||
if [ -z "$3" ]; then
|
if [ -z "$3" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> kick <player-name>"
|
||||||
else
|
else
|
||||||
if server_is_running "$id"; then
|
if server_is_running "$id"; then
|
||||||
local line="$(server_eval_and_get_line "$id" "kick $3" "${server_confirm_kick[$id]}" "${server_confirm_kick_fail[$id]}")"
|
local line="$(server_eval_and_get_line "$id" "kick $3" "${server_confirm_kick[$id]}" "${server_confirm_kick_fail[$id]}")"
|
||||||
@ -2111,7 +2131,7 @@ main() {
|
|||||||
;;
|
;;
|
||||||
say)
|
say)
|
||||||
if [ -z "$3" ]; then
|
if [ -z "$3" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> say <message>"
|
||||||
else
|
else
|
||||||
if server_is_running "$id"; then
|
if server_is_running "$id"; then
|
||||||
server_eval "$id" "say ${*:3}"
|
server_eval "$id" "say ${*:3}"
|
||||||
@ -2125,7 +2145,7 @@ main() {
|
|||||||
case "$3" in
|
case "$3" in
|
||||||
set)
|
set)
|
||||||
if [ -z "$4" ]; then
|
if [ -z "$4" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> time set <time-string>"
|
||||||
else
|
else
|
||||||
if server_is_running "$id"; then
|
if server_is_running "$id"; then
|
||||||
local line="$(server_eval_and_get_line "$id" "time set $4" "${server_confirm_time_set[$id]}" "${server_confirm_time_set_fail[$id]}")"
|
local line="$(server_eval_and_get_line "$id" "time set $4" "${server_confirm_time_set[$id]}" "${server_confirm_time_set_fail[$id]}")"
|
||||||
@ -2145,7 +2165,7 @@ main() {
|
|||||||
;;
|
;;
|
||||||
add)
|
add)
|
||||||
if [ -z "$4" ]; then
|
if [ -z "$4" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> time add <time-string>"
|
||||||
else
|
else
|
||||||
if server_is_running "$id"; then
|
if server_is_running "$id"; then
|
||||||
local line="$(server_eval_and_get_line "$id" "time add $4" "${server_confirm_time_add[$id]}" "${server_confirm_time_add_fail[$id]}")"
|
local line="$(server_eval_and_get_line "$id" "time add $4" "${server_confirm_time_add[$id]}" "${server_confirm_time_add_fail[$id]}")"
|
||||||
@ -2164,7 +2184,7 @@ main() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> time set|add"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -2186,23 +2206,15 @@ main() {
|
|||||||
;;
|
;;
|
||||||
save)
|
save)
|
||||||
case "$3" in
|
case "$3" in
|
||||||
on)
|
on) server_save_on "$id";;
|
||||||
server_save_on "$id"
|
off) server_save_off "$id";;
|
||||||
;;
|
all) server_save_all "$id";;
|
||||||
off)
|
*) error_exit INVALID_COMMAND "Usage: $0 <server-name> save on|off|all";;
|
||||||
server_save_off "$id"
|
|
||||||
;;
|
|
||||||
all)
|
|
||||||
server_save_all "$id"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
cmd)
|
cmd)
|
||||||
if [ -z "$3" ]; then
|
if [ -z "$3" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> cmd <command-string>"
|
||||||
else
|
else
|
||||||
if server_is_running "$id"; then
|
if server_is_running "$id"; then
|
||||||
server_eval "$id" "${*:3}"
|
server_eval "$id" "${*:3}"
|
||||||
@ -2214,7 +2226,7 @@ main() {
|
|||||||
;;
|
;;
|
||||||
cmdlog)
|
cmdlog)
|
||||||
if [ -z "$3" ]; then
|
if [ -z "$3" ]; then
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Usage: $0 <server-name> cmdlog <command-string>"
|
||||||
else
|
else
|
||||||
if server_is_running "$id"; then
|
if server_is_running "$id"; then
|
||||||
server_eval "$id" "${*:3}"
|
server_eval "$id" "${*:3}"
|
||||||
@ -2233,7 +2245,7 @@ main() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error_exit INVALID_COMMAND "Invalid command."
|
error_exit INVALID_COMMAND "Invalid command. See \"$0 help\" for more information."
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user