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

46 lines
1.5 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
#
# Scritp to launch server khanat
# 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/>.
declare METHOD_START=$1
/etc/init.d/mysql restart
/etc/init.d/apache2 restart
/etc/init.d/ssh restart
source /opt/shard.sh
tmp=$(hostname -I)
export addressip=${tmp//[[:blank:]]/}
sed -i -r 's/(FSListenHost)(.*)(=)(.*)(;)/FSListenHost = "'"$addressip"'";/g' $KHANAT_PATH/server/frontend_service.cfg || exit 2
/opt/serverimage_prepare_start_server.sh || exit 2
if [[ $METHOD_START -eq 1 ]]
then
export RYZOM_PATH=$KHANAT_PATH
/home/gameserver/khanat/tools/scripts/linux/shard start
elif [[ $METHOD_START -eq 2 ]]
then
bash /opt/serverimage_launch_services.sh
sleep 10
tail -n+0 -f /home/gameserver/khanat/server/log/log.log
else
bash /opt/serverimage_launch_services.sh
sleep 10
watch cat /home/gameserver/khanat/server/aes_nagios_report.txt
fi