From 173895ec284773b035e0f0c1ebd17bbbd1ffc36f Mon Sep 17 00:00:00 2001 From: Marcus Whybrow Date: Mon, 21 May 2012 14:48:18 +0100 Subject: [PATCH] Renamed "jars remote" to "jar group" and a few other renames. --- msm | 53 ++++++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/msm b/msm index d584514..0888d2d 100755 --- a/msm +++ b/msm @@ -24,7 +24,7 @@ WHITELIST="white-list.txt" BANNED_IPS="banned-ips.txt" BANNED_PLAYERS="banned-players.txt" -JAR_REMOTE_TARGET="target.txt" +JAR_GROUP_TARGET="target.txt" JAR_DOWNLOAD_DIR="downloads" @@ -96,13 +96,13 @@ manager_create_server() { fi } -manager_jars_remote_create() { +manager_jars_group_create() { if is_valid_name $1; then if [[ -e $JAR_STORAGE_PATH/$1 ]]; then - echo "A remote with that name already exists." + echo "A jar group with that name already exists." exit 2 else - printf "Create a remote jar group... " + printf "Creating jar group... " local error=$(as_user_stderr "mkdir -p $JAR_STORAGE_PATH/$1") if [[ $error != "" ]]; then @@ -111,7 +111,7 @@ manager_jars_remote_create() { exit 1 fi - error=$(as_user "echo \"$2\" > $JAR_STORAGE_PATH/$1/$JAR_REMOTE_TARGET") + error=$(as_user "echo \"$2\" > $JAR_STORAGE_PATH/$1/$JAR_GROUP_TARGET") if [[ $error != "" ]]; then echo "Failed." echo "Reason: $error" @@ -121,7 +121,7 @@ manager_jars_remote_create() { echo "Done." # Download the latest version now - manager_jars_remote_getlatest $1 + manager_jars_group_getlatest $1 fi else @@ -130,9 +130,9 @@ manager_jars_remote_create() { fi } -manager_jars_remote_getlatest() { +manager_jars_group_getlatest() { if is_valid_name "$1" && [[ -e $JAR_STORAGE_PATH/$1 ]]; then - if [[ -e $JAR_STORAGE_PATH/$1/$JAR_REMOTE_TARGET ]]; then + if [[ -e $JAR_STORAGE_PATH/$1/$JAR_GROUP_TARGET ]]; then printf "Downloading latest version... " # Try and make @@ -143,7 +143,7 @@ manager_jars_remote_getlatest() { exit 1 fi - as_user "wget --quiet --input-file=$JAR_STORAGE_PATH/$1/$JAR_REMOTE_TARGET --directory-prefix=$JAR_STORAGE_PATH/$1/$JAR_DOWNLOAD_DIR --no-check-certificate" + as_user "wget --quiet --input-file=$JAR_STORAGE_PATH/$1/$JAR_GROUP_TARGET --directory-prefix=$JAR_STORAGE_PATH/$1/$JAR_DOWNLOAD_DIR --no-check-certificate" echo "Done." local num_files=$(as_user "ls -1 $JAR_STORAGE_PATH/$1/$JAR_DOWNLOAD_DIR | wc -l") @@ -188,11 +188,11 @@ manager_jars_remote_getlatest() { echo "Target URL not found." fi else - echo "No remote with that name." + echo "No jar group with that name." fi } -manager_jars_remote_delete() { +manager_jars_group_delete() { if is_valid_name "$1" && [[ -e $JAR_STORAGE_PATH/$1 ]]; then printf "Are you sure you want to delete this jar group [y/N]: " @@ -204,7 +204,7 @@ manager_jars_remote_delete() { echo "Jar group was NOT deleted." fi else - echo "No remote with that name." + echo "No jar group with that name." fi } @@ -234,20 +234,20 @@ case "$1" in jars) # Jar commands case "$2" in - remote) + group) case "$3" in create) - manager_jars_remote_create $4 $5 + manager_jars_group_create $4 $5 ;; delete) - manager_jars_remote_delete $4 + manager_jars_group_delete $4 ;; rename) ;; change) ;; getlatest) - manager_jars_remote_getlatest $4 + manager_jars_group_getlatest $4 ;; esac ;; @@ -282,10 +282,10 @@ case "$1" in echo -e "--Server Pass Through Commands----------------------------------" echo -e " wl on|off \t\t\tEnabled/disable server whitelist check" echo -e " wl add|remove \t\tAdd/remove a player to/from a server's whitelist" - echo -e " wl \t\t\t\t\tList the players whitelisted for a server" + echo -e " wl list \t\t\t\tList the players whitelisted for a server" echo -e " bl player add|remove \tBan/pardon a player from/for a server" echo -e " bl ip add|remove \tBan/pardon an IP address from/for a server" - echo -e " bl \t\t\t\t\tLists the banned players and IP address for a server" + echo -e " bl list \t\t\t\tLists the banned players and IP address for a server" echo -e " op add|remove \t\tAdd/remove operator status for a player on a server" echo -e " gm survival|creative \tChange the game mode for a player on a server" echo -e " kick \t\t\tForcibly disconnect a player from a server" @@ -298,18 +298,21 @@ case "$1" in echo -e " cmdlog \t\t\tSame as 'cmd' but shows log output afterwards (Ctrl+C to exit)" echo -e echo -e "--Jar Commands--------------------------------------------------" - echo -e " jars \t\t\t\t\t\tList the stored jar files." - echo -e " jars remote create \tCreate a new jar directory, with the \"always latest\" download URL" - echo -e " jars remote delete \t\t\tDelete a jar directory" - echo -e " jars remote rename \t\tRename a jar directory" - echo -e " jars remote change \tChange the remove download link for a jar directory" - echo -e " jars remote getlatest \t\t\tDownload the latest jar file" + echo -e " jar list\t\t\t\t\tList the stored jar files." + echo -e " jar group create \tCreate a new jar directory, with the \"always latest\" download URL" + echo -e " jar group delete \t\t\tDelete a jar directory" + echo -e " jar group rename \t\tRename a jar directory" + echo -e " jar group change \tChange the remove download link for a jar directory" + echo -e " jar group getlatest \t\t\tDownload the latest jar file" echo -e - echo -e "--Init.d Commands-----------------------------------------------" + echo -e "--Global Commands-----------------------------------------------" echo -e " start \t\t\t\t\tStarts all active servers" echo -e " stop \t\t\t\t\t\tStops all running servers" echo -e " restart \t\t\t\t\tRestarts all active servers" ;; + "") + echo "No such command see: $0 help" + ;; *) # TODO: Check first if $1 is an existing server name