khanat-code-old/dist/docker/server/debian/common/serverimage_install_package.sh
2017-10-09 22:11:54 +02:00

80 lines
3 KiB
Bash
Executable file

#!/bin/bash
#
# Install binary and data
#
# Copyright (C) 2017 AleaJactaEst
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
echo "INSTALL PACKAGE"
# Load Environment
source /etc/apache2/envvars
export KHANAT_CLIENT_VERSION=1
if [[ ! -f /home/gameserver/.bashrc ]]
then
echo "ERROR - missing /home/gameserver/.bashrc"
exit 2
fi
source /home/gameserver/.bashrc
# install new package
cd /; tar xzf /opt/ryzomcore.tar.gz --strip 1 || exit 2
cd /opt; tar xzf ryzom-ressources.tar.gz || exit 2
# Create Home directory (if not exist)
mkdir -p $KHANAT_PATH || exit 2
# install web khanat
cp -r /opt/code/web $KHANAT_PATH/khanatweb || exit 2
chmod -R a+w $KHANAT_PATH/khanatweb || exit 2
chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $KHANAT_PATH/khanatweb || exit 2
# Get Ressource
mkdir -p $KHANAT_DATA/ressources
(cd $KHANAT_DATA; tar xzf /opt/khanat-ressources.tar.gz) || exit 2
# Copy script ryzom
mkdir -p $KHANAT_PATH/tools/scripts/linux
cp -r /opt/code/ryzom/tools/scripts/linux/* $KHANAT_PATH/tools/scripts/linux || exit 2
# Copy data for server
mkdir -p $KHANAT_PATH/server || exit 2
cp -r /opt/code/ryzom/common/ $KHANAT_PATH/common || exit 2
cp -r /opt/code/ryzom/client/ $KHANAT_PATH/client || exit 2
cp /opt/code/ryzom/server/*.cfg $KHANAT_PATH/server/. || exit 2
# create link resource
## Directories
ln -s $KHANAT_DATA/collisions $KHANAT_PATH/server/
ln -s $KHANAT_DATA/leveldesign $KHANAT_PATH/server/
ln -s $KHANAT_DATA/primitives $KHANAT_PATH/server/
ln -s $KHANAT_DATA/translation $KHANAT_PATH/server/
ln -s $KHANAT_DATA/continents $KHANAT_PATH/server/
ln -s $KHANAT_DATA/common $KHANAT_PATH/server/
## Files
mkdir -p $KHANAT_PATH/server/data_shard
cp -r /opt/code/ryzom/server/data_shard/* $KHANAT_PATH/server/data_shard/.
ln -s $KHANAT_DATA/shard/su/dev_gm_names.xml $KHANAT_PATH/server/data_shard/dev_gm_names.xml
ln -s $KHANAT_DATA/shard/su/invalid_entity_names.txt $KHANAT_PATH/server/data_shard/invalid_entity_names.txt
ln -s $KHANAT_DATA/shard/su/reserved_names.xml $KHANAT_PATH/server/data_shard/reserved_names.xml
ln -s $KHANAT_DATA/shard/egs/game_event.txt $KHANAT_PATH/server/data_shard/game_event.txt
ln -s $KHANAT_DATA/shard/egs/mission_queues.txt $KHANAT_PATH/server/data_shard/mission_queues.txt
ln -s $KHANAT_DATA/shard/egs/named_items.txt $KHANAT_PATH/server/data_shard/named_items.txt
# copy data from khanat-code
mkdir -p $KHANAT_DATA/mirror_sheets
cp -r /opt/code/ryzom/server/data_shard/mirror_sheets/* $KHANAT_DATA/mirror_sheets