mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-10 09:19:01 +00:00
82 lines
2.9 KiB
Bash
Executable file
82 lines
2.9 KiB
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# Script to create package khanat_client
|
|
# 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 "PREPARE PACKAGE KHANAT CLIENT"
|
|
|
|
# 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
|
|
|
|
declare DIRCLIENT="Khanat_Linux64"
|
|
declare HOME_PREPARE_CLIENT="$KHANAT_HOME/prepare_client/$DIRCLIENT"
|
|
declare HOME_CLIENT="$KHANAT_HOME/client_service"
|
|
|
|
# Create directory
|
|
mkdir -p $HOME_PREPARE_CLIENT || exit 2
|
|
mkdir -p $HOME_PREPARE_CLIENT/{data,cfg,save,user,cache} || exit 2
|
|
mkdir -p $HOME_CLIENT || exit 2
|
|
|
|
# Copy all data
|
|
cp /usr/local/games/khanat_client $HOME_PREPARE_CLIENT/. || exit 2
|
|
cp /usr/local/etc/ryzom/client_default.cfg $HOME_PREPARE_CLIENT/. || exit 2
|
|
sed -i -r 's/PatchWanted = 0;/PatchWanted = 1;/g' $HOME_PREPARE_CLIENT/client_default.cfg || exit 2
|
|
|
|
cp $PATCH_HOME/patch_service/patch_game/bnp/kh_translate_{wk,fr,en}.bnp $HOME_PREPARE_CLIENT/data/. || exit 2
|
|
cp $PATCH_HOME/patch_service/dataserver/client/exedll_linux64/khanat.png $HOME_PREPARE_CLIENT/data/. || exit 2
|
|
cp $PATCH_HOME/patch_service/dataserver/data/fonts.bnp $HOME_PREPARE_CLIENT/data/. || exit 2
|
|
cp $PATCH_HOME/patch_service/patch_game/bnp/kh_interfaces.bnp $HOME_PREPARE_CLIENT/data/. || exit 2
|
|
cp $PATCH_HOME/patch_service/patch_game/bnp/ryz_zzz_bazaar.bnp $HOME_PREPARE_CLIENT/data/. || exit 2
|
|
cp $PATCH_HOME/khanat/client/cfg/* $HOME_PREPARE_CLIENT/cfg/. || exit 2
|
|
|
|
# TODO - we need search where are define some files
|
|
# .DS_Store : function ?
|
|
# khanat_install_desktop_menu.sh : script to install khanat on desktop
|
|
# khanat.desktop.in : config desktop for khanat
|
|
# khanat_install_desktop_menu.sh : script to uninstall khanat on desktop
|
|
|
|
# Generate package
|
|
#(cd $PATCH_HOME/..; 7z a smokey_linux64.7z $DIRCLIENT)
|
|
(cd $HOME_PREPARE_CLIENT/..; tar cfz $HOME_CLIENT/smokey_linux64.tar.gz $DIRCLIENT)
|
|
|
|
# create index for client
|
|
cat << EOF > $HOME_CLIENT/index.html
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>KHANAT CLIENT</title>
|
|
</head>
|
|
<body>
|
|
|
|
<h1>You can download khanat client</h1>
|
|
<a href="smokey_linux64.tar.gz">khanat client</a>
|
|
|
|
</body>
|
|
</html>
|
|
EOF
|
|
chown -R gameserver:$APACHE_RUN_GROUP $HOME_CLIENT
|
|
|
|
#################################
|
|
#
|
|
#################################
|
|
|