mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
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:
parent
3f8c3cc277
commit
ddbc46927c
22
init/msm
22
init/msm
@ -1988,17 +1988,19 @@ command_server_console() {
|
|||||||
# $2: The parameter
|
# $2: The parameter
|
||||||
# $3: The value to set it to
|
# $3: The value to set it to
|
||||||
command_set_config() {
|
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
|
if server_is_running "$1"; then
|
||||||
echo "Server is running, restarting in 10secs to ensure update"
|
echo "Server is running, please stop the server before running this command: sudo msm "${SERVER_NAME[$1]}" stop"
|
||||||
command_server_restart $1;
|
else
|
||||||
fi
|
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
|
### Main Functions
|
||||||
|
Loading…
Reference in New Issue
Block a user