khanat-server-docker-NeL/server/debian/common/serverimage_prepare_start_server.sh

58 lines
1.7 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
#
# Script to update khanat configuration (change ip address)
#
# Copyright (C) 2017 AleaJactaEst
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
echo "PREPARE ENVIRONMENT"
# Load Environment
export KHANAT_CLIENT_VERSION=1
if [[ ! -f /home/gameserver/.bashrc ]]
then
echo "ERROR - missing /home/gameserver/.bashrc"
exit 2
fi
source /home/gameserver/.bashrc
# Get IP ADDRESS
tmp=$(hostname -I)
export addressip=${tmp//[[:blank:]]/}
## Configure Domain
mysql -u root -e "use nel;
UPDATE nel.domain
SET backup_patch_url = '$addressip:23001'
, patch_urls = '$addressip/patch'
, login_address = '$addressip:49998'
, session_manager_address = '$addressip:49999'
, web_host = '$addressip:30000'
, web_host_php = '$addressip:40916'
WHERE domain_id = 12;" || exit 2
# Configure nel.shard
mysql -u root -e "use nel;
UPDATE nel.shard
SET WsAddr = '$addressip:'
WHERE ShardId = 302;" || exit 2
# Configure nel_tool.neltool_domains
mysql -u root -e "use nel;
UPDATE nel_tool.neltool_domains
SET domain_as_host = '$addressip'
WHERE domain_id = 12;" || exit 2