Réorganisation du dépôt.

Afin de prendre en compte les nouvelles branches du serveur NALC.
This commit is contained in:
2019-04-22 14:40:36 +02:00
parent 62a7a6070a
commit 8eeceb1ac8
14 changed files with 268 additions and 549 deletions

View File

@@ -30,6 +30,7 @@ usage() {
echo -e "\t-p --postgresql\tSi vous voulez que le serveur soit configuré avec postgresql"
echo "version :"
echo -e "\tstable : Installation du serveur depuis sa branche stable. Suivez les instructions... (À priori stable)"
echo -e "\t1.1 : Installation du serveur depuis la branche 1.1 compatible Minetest 5.0. Suivez les instructions... (Stable)"
echo -e "\t1.0 : Installation du serveur compatible avec minetest-0.4.17.x. Suivez les instructions... (Stable)"
echo -e "\tdev : Installation de la version en cours de developpement du serveur. Suivez les instructions... (Non Stable !)"
exit 0
@@ -71,6 +72,9 @@ postgresql() {
echo "gameid = nalc_game" > world.mt
echo "backend = postgresql" >> world.mt
echo "player_backend = postgresql" >> world.mt
if [[ $ver == "1.1" || $ver == "stable" || $ver == "dev" ]]; then
echo "auth_backend = sqlite3" >> world.mt
fi
echo "pgsql_connection = host=$pg_url user=$pg_user password=$pg_password dbname=$pg_dbname" >> world.mt
echo "pgsql_player_connection = host=$pg_url user=$pg_user password=$pg_password dbname=players-$pg_dbname" >> world.mt
}
@@ -106,9 +110,9 @@ install_minetest() {
if [[ ! -d minetest ]]; then
local branch="-b master"
if [[ $ver == "stable" || $ver == "1.0" ]]; then
if [[ $ver == "1.0" ]]; then
branch="-b stable-0.4"
elif [[ $ver == "dev" ]]; then
elif [[ $ver == "stable" || $ver == "1.1" || $ver == "dev" ]]; then
branch="-b stable-5"
fi
git clone --depth 1 $branch https://gitlab.com/minetest/minetest.git
@@ -154,7 +158,9 @@ install_minetest_game() {
if [[ ! -d nalc_game ]]; then
local branch="-b master"
if [[ $ver == "1.0" ]]; then
branch="-b nalc-1.0.0"
branch="-b nalc-1.0"
elif [[ $ver == "1.1" ]]; then
branch="-b nalc-1.1"
elif [[ $ver == "stable" ]];then
branch="-b nalc"
elif [[ $ver == "dev" ]]; then
@@ -210,6 +216,12 @@ install_world() {
cp -r world/* minetest/worlds/$world_name/
fi
if [[ $ver == "stable" || $ver == "dev" ]]; then
cp news-1.1.txt minetest/worlds/$world_name/
else
cp news-$ver.txt minetest/worlds/$world_name/
fi
}
install_mods() {
@@ -249,9 +261,12 @@ install_mods() {
# Recréation des liens symboliques et du fichier world.mt (dans tous les cas)
rm minetest/mods/*
if [[ -a world.mt && -z $pg_dbname ]]; then
rm world.mt
cp worldmt.conf world.mt
if [[ -z $pg_dbname ]]; then
if [[ $ver == "1.0" ]]; then
cp worldmt-1.0.conf world.mt
elif [[ $ver == "1.1" || $ver == "stable" || $ver == "dev" ]]; then
cp worldmt-1.1.conf world.mt
fi
fi
if [[ -d custom/mods ]]; then
@@ -265,9 +280,9 @@ install_mods() {
local i=0
local md[1]="" # Mods to disable
local mods="3d_armor_ip 3d_armor_sfinv worldedit_brush"
if [[ $ver == "dev" ]]; then
mods="3d_armor_ip 3d_armor_sfinv"
local mods="3d_armor_ip 3d_armor_sfinv"
if [[ $ver == "1.0" ]]; then
mods="3d_armor_ip 3d_armor_sfinv worldedit_brush"
fi
for mod in $mods; do
i=$(( $i+1 ))
@@ -307,7 +322,11 @@ install_mods() {
post_install() {
if [[ ! -a minetest/minetest.conf ]]; then
cp minetest-$ver.conf minetest/minetest.conf
if [[ $ver == "stable" || $ver == "dev" ]]; then
cp minetest-1.1.conf minetest/minetest.conf
else
cp minetest-$ver.conf minetest/minetest.conf
fi
echo "Veuillez éditer le fichier $(pwd)/minetest/minetest.conf"
fi