From 110e56ca207e6d70bc79b0f6709732e4685820fe Mon Sep 17 00:00:00 2001 From: Marcus Whybrow Date: Wed, 11 Jul 2012 07:27:55 +0100 Subject: [PATCH] config command always goes ahead, but reminds user to restart if server is running. --- init/msm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/init/msm b/init/msm index 9185bd4..5ec889e 100755 --- a/init/msm +++ b/init/msm @@ -1987,16 +1987,15 @@ command_server_console() { # $2: The parameter # $3: The value to set it to command_set_config() { - if server_is_running "$1"; then - echo "Server is running, please stop the server before running this command: sudo msm "${SERVER_NAME[$1]}" stop" - else - if [[ -f "${SERVER_CONF[$1]}" ]]; then - if grep "$2" ${SERVER_CONF[$1]} >/dev/null; then - sed -i /$2=/s/.*/"$2=$3"/g ${SERVER_CONF[$1]} - else - echo "$2=$3" >> ${SERVER_CONF[$1]} - fi - echo "To see these changes please restart this server with: sudo msm "${SERVER_NAME[$1]}" start"; + if [[ -f "${SERVER_CONF[$1]}" ]]; then + if grep "$2" ${SERVER_CONF[$1]} >/dev/null; then + sed -i /$2=/s/.*/"$2=$3"/g ${SERVER_CONF[$1]} + else + echo "$2=$3" >> ${SERVER_CONF[$1]} + fi + + if server_is_running "$1"; then + echo "Changes to config may require a server restart to take effect: sudo $0 ${SERVER_NAME[$1]} restart"; fi fi }