Changed it so that the server must be shut down by the user before config changes and manually restarted afterwards

This commit is contained in:
Cameron 2012-07-11 15:33:48 +10:00
parent 3f8c3cc277
commit ddbc46927c

View File

@ -1988,17 +1988,19 @@ command_server_console() {
# $2: The parameter
# $3: The value to set it to
command_set_config() {
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
fi
if server_is_running "$1"; then
echo "Server is running, restarting in 10secs to ensure update"
command_server_restart $1;
fi
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";
fi
fi
}
### Main Functions