mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
Validation checks for create and server commands.
This commit is contained in:
parent
173895ec28
commit
bef9ce7916
90
msm
90
msm
@ -223,7 +223,11 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
create)
|
create)
|
||||||
# Create a new server
|
# Create a new server
|
||||||
manager_create_server $2
|
if [ -z $2 ]; then
|
||||||
|
echo "Invalid command."
|
||||||
|
else
|
||||||
|
manager_create_server $2
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
delete)
|
delete)
|
||||||
# Delete an existing server, with confirmation
|
# Delete an existing server, with confirmation
|
||||||
@ -316,46 +320,50 @@ case "$1" in
|
|||||||
*)
|
*)
|
||||||
# TODO: Check first if $1 is an existing server name
|
# TODO: Check first if $1 is an existing server name
|
||||||
|
|
||||||
case "$2" in
|
if is_valid_name "$1" && [[ -e $SERVER_STORAGE_PATH/$1 ]]; then
|
||||||
start)
|
case "$2" in
|
||||||
;;
|
start)
|
||||||
stop)
|
;;
|
||||||
;;
|
stop)
|
||||||
restart)
|
;;
|
||||||
;;
|
restart)
|
||||||
worlds)
|
;;
|
||||||
;;
|
worlds)
|
||||||
backup)
|
;;
|
||||||
;;
|
backup)
|
||||||
logroll)
|
;;
|
||||||
;;
|
logroll)
|
||||||
connected)
|
;;
|
||||||
;;
|
connected)
|
||||||
status)
|
;;
|
||||||
;;
|
status)
|
||||||
whitelist|wl)
|
;;
|
||||||
;;
|
whitelist|wl)
|
||||||
blacklist|bl)
|
;;
|
||||||
;;
|
blacklist|bl)
|
||||||
operator|op)
|
;;
|
||||||
;;
|
operator|op)
|
||||||
gamemode|gm)
|
;;
|
||||||
;;
|
gamemode|gm)
|
||||||
kick)
|
;;
|
||||||
;;
|
kick)
|
||||||
say)
|
;;
|
||||||
;;
|
say)
|
||||||
"time")
|
;;
|
||||||
;;
|
"time")
|
||||||
toggledownfall)
|
;;
|
||||||
;;
|
toggledownfall)
|
||||||
save)
|
;;
|
||||||
;;
|
save)
|
||||||
cmd)
|
;;
|
||||||
;;
|
cmd)
|
||||||
cmdlog)
|
;;
|
||||||
;;
|
cmdlog)
|
||||||
esac
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
echo "No server with that name."
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user