64 lines
1.9 KiB
Bash
64 lines
1.9 KiB
Bash
|
#!/bin/bash
|
||
|
#
|
||
|
# Configure environment
|
||
|
# 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/>.
|
||
|
|
||
|
####################################
|
||
|
# Load Environment
|
||
|
####################################
|
||
|
if [[ ! -f /opt/khanat_config.sh ]]
|
||
|
then
|
||
|
echo "ERROR - missing /opt/khanat_config.sh"
|
||
|
exit 2
|
||
|
fi
|
||
|
source /opt/khanat_config.sh
|
||
|
|
||
|
|
||
|
echo "CONFIGURE ENVIRONMENT"
|
||
|
|
||
|
# configure environment
|
||
|
cat << EOF > /opt/shard.sh
|
||
|
export KHANAT_HOME=/home/gameserver
|
||
|
export KHANAT_PATH=/home/gameserver/khanat
|
||
|
export PATH=\$PATH:/usr/local/bin:/usr/local/sbin:\$KHANAT_PATH/tools/scripts/linux
|
||
|
export KHANAT_DATA=/home/gameserver/khanat-ressources
|
||
|
export PATCH_HOME=/home/gameserver
|
||
|
export PATCH_CLIENT_SYSTEM=\$PATCH_HOME/patch_service
|
||
|
export WORKDIRCLIENT="$WORKDIRCLIENT"
|
||
|
export PACKAGECLIENT="$PACKAGECLIENT"
|
||
|
EOF
|
||
|
|
||
|
# configure environment
|
||
|
cat << EOF > /home/gameserver/.bashrc
|
||
|
export KHANAT_HOME=/home/gameserver
|
||
|
export KHANAT_PATH=/home/gameserver/khanat
|
||
|
export PATH=\$PATH:/usr/local/bin:\$KHANAT_PATH/tools/scripts/linux
|
||
|
export KHANAT_DATA=/home/gameserver/khanat-ressources
|
||
|
export PATCH_HOME=/home/gameserver
|
||
|
export PATCH_CLIENT_SYSTEM=\$PATCH_HOME/patch_service
|
||
|
export WORKDIRCLIENT="$WORKDIRCLIENT"
|
||
|
export PACKAGECLIENT="$PACKAGECLIENT"
|
||
|
EOF
|
||
|
|
||
|
# load environment
|
||
|
source /home/gameserver/.bashrc
|
||
|
|
||
|
# Initialize ssh
|
||
|
/etc/init.d/ssh restart
|
||
|
|
||
|
|
||
|
|