Mise à jour vers nouveau serveur git et corrections
This commit is contained in:
parent
b2c16a547e
commit
05474b276f
229
install.sh
229
install.sh
@ -29,8 +29,9 @@ usage() {
|
||||
echo -e "\t-i --irrlicht\tChemin personnalisé des sources irrlicht."
|
||||
echo -e "\t-p --postgresql\tSi vous voulez que le serveur soit configuré avec postgresql"
|
||||
echo "Arguments :"
|
||||
echo -e "\t0.5 : Installation du serveur avec minetest-0.5.x. Suivez les instructions... (Non stable !)"
|
||||
echo -e "\t5 : Installation du serveur avec minetest-5.x. Suivez les instructions... (Non stable !)"
|
||||
echo -e "\t0.4 : Installation du serveur avec minetest-0.4.x. Suivez les instructions... (Stable)"
|
||||
echo -e "\tmaster : Installation du serveur avec la branche master de minetest. Suivez les instructions... (Non Stable !)"
|
||||
exit 0
|
||||
}
|
||||
|
||||
@ -67,7 +68,7 @@ postgresql() {
|
||||
read -p "Indiquez le mot de passe : " pg_password
|
||||
read -p "Indiquez le nom de la BDD à utiliser : " pg_dbname
|
||||
|
||||
echo "gameid = minetest_game" > world.mt
|
||||
echo "gameid = nalc_game" > world.mt
|
||||
echo "backend = postgresql" >> world.mt
|
||||
echo "player_backend = postgresql" >> world.mt
|
||||
echo "pgsql_connection = host=$pg_url user=$pg_user password=$pg_password dbname=$pg_dbname" >> world.mt
|
||||
@ -139,6 +140,8 @@ install_minetest() {
|
||||
local branch="-b master"
|
||||
if [[ $ver == "0.4" ]]; then
|
||||
branch="-b stable-0.4"
|
||||
elif [[ $ver == "5" ]]; then
|
||||
branch="-b stable-5.0"
|
||||
fi
|
||||
git clone --depth 1 $branch https://github.com/minetest/minetest.git
|
||||
verif
|
||||
@ -147,28 +150,28 @@ install_minetest() {
|
||||
echo "Minetest va être (re)compilé..."
|
||||
sleep 3
|
||||
cd minetest
|
||||
cmake . -DBUILD_CLIENT=0 -DBUILD_SERVER=1 -DENABLE_SOUND=0 -DENABLE_SYSTEM_GMP=1 $irrlicht_src -DENABLE_LEVELDB=0 -DENABLE_REDIS=1 -DENABLE_POSTGRESQL=1 -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LUAJIT=1 -DENABLE_CURL=1
|
||||
cmake . -DBUILD_CLIENT=0 -DBUILD_SERVER=1 -DENABLE_SOUND=0 -DENABLE_SYSTEM_GMP=1 $irrlicht_src -DENABLE_LEVELDB=1 -DENABLE_REDIS=1 -DENABLE_POSTGRESQL=1 -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LUAJIT=1 -DENABLE_CURL=1
|
||||
make -j$makeopt
|
||||
echo "Installation de Minetest terminé."
|
||||
cd ..
|
||||
}
|
||||
|
||||
install_minetest_game() {
|
||||
if [[ -d minetest_game ]]; then
|
||||
echo "Installation précédente du jeux Minetest détecté."
|
||||
if [[ -d nalc_game ]]; then
|
||||
echo "Installation précédente du jeux NALC détecté."
|
||||
read -p "Mettre à jour ? (y,n,clean,cancel) " continue
|
||||
if [[ $continue == "y" ]]; then
|
||||
cd minetest_game
|
||||
cd nalc_game
|
||||
git pull
|
||||
verif
|
||||
cd ..
|
||||
echo "Mise à jour du jeux Minetest depuis dépôt distant terminé."
|
||||
echo "Mise à jour du jeux NALC depuis dépôt distant terminé."
|
||||
elif [[ $continue == "clean" ]]; then
|
||||
echo "/!\ Cette action va effacer les données du répertoire minetest_game"
|
||||
echo "/!\ Cette action va effacer les données du répertoire nalc_game"
|
||||
read -p "Êtes-vous sûr de vouloir continuer ? (y or n) " continue
|
||||
if [[ $continue == "y" ]]; then
|
||||
rm -rf minetest_game
|
||||
echo "Jeux Minetest supprimé."
|
||||
rm -rf nalc_game
|
||||
echo "Jeux NALC supprimé."
|
||||
else
|
||||
echo "Mise à jour annulée. Terminé."
|
||||
exit 0
|
||||
@ -179,31 +182,37 @@ install_minetest_game() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -d minetest_game ]]; then
|
||||
if [[ ! -d nalc_game ]]; then
|
||||
local branch="-b master"
|
||||
if [[ $ver == "0.4" ]]; then
|
||||
branch="-b stable-0.4"
|
||||
branch="-b nalc"
|
||||
elif [[ $ver == "5" ]]; then
|
||||
branch="-b stable-5.0"
|
||||
fi
|
||||
git clone --depth 1 $branch https://github.com/minetest/minetest_game.git
|
||||
git clone --depth 1 $branch $URL/nalc_game.git
|
||||
verif
|
||||
echo "Clonage de minetest_game terminé."
|
||||
echo "Clonage de nalc_game terminé."
|
||||
fi
|
||||
|
||||
if [[ ! -L minetest/games/minetest_game ]]; then
|
||||
ln -s $(pwd)/minetest_game minetest/games/minetest_game
|
||||
echo "Lien symbolique minetest/games/minetest_game vers $(pwd)/minetest_game créé."
|
||||
if [[ ! -L minetest/games/nalc_game ]]; then
|
||||
ln -s $(pwd)/nalc_game minetest/games/nalc_game
|
||||
echo "Lien symbolique minetest/games/nalc_game vers $(pwd)/nalc_game créé."
|
||||
fi
|
||||
|
||||
echo "Installation/Mise à jour du jeux Minetest terminé."
|
||||
echo "Installation/Mise à jour du jeux NALC terminé."
|
||||
}
|
||||
|
||||
install_world() {
|
||||
if [[ -d minetest/worlds/nalc ]]; then
|
||||
local world_name="nalc"
|
||||
if [[ -n $pg_dbname ]]; then
|
||||
world_name=$pg_dbname
|
||||
fi
|
||||
if [[ -d minetest/worlds/$world_name ]]; then
|
||||
echo "Une map est déjà présente. Que souhaitez-vous faire ?"
|
||||
read -p "Choisissez parmi la liste ([1]Nouveau, [2]Utiliser) : " continuer
|
||||
if [[ $continuer == 1 ]]; then
|
||||
if [[ -n $pg_dbname ]]; then
|
||||
read -p "Les BDD $pg_name et players-$pg_name ne seront pas effacées. À vous de le faire manuellement après ce script ! -- Press enter -- : " continuer
|
||||
read -p "Les BDD $pg_dbname et players-$pg_dbname ne seront pas effacées. À vous de le faire manuellement après ce script ! -- Press enter -- : " continuer
|
||||
|
||||
# dropdb $pg_dbname
|
||||
# dropdb players-$pg_dbname
|
||||
@ -211,82 +220,82 @@ install_world() {
|
||||
# createdb players-$pg_dbname
|
||||
fi
|
||||
|
||||
if [[ -d minetest/worlds/nalc_old ]]; then
|
||||
rm -rf minetest/worlds/nalc_old
|
||||
if [[ -d "minetest/worlds/"$world_name"_old" ]]; then
|
||||
rm -rf "minetest/worlds/"$world_name"_old"
|
||||
fi
|
||||
|
||||
mv minetest/worlds/nalc minetest/worlds/nalc_old
|
||||
mv minetest/worlds/$world_name "minetest/worlds/"$world_name"_old"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -d minetest/worlds/nalc ]]; then
|
||||
mkdir -p minetest/worlds/nalc
|
||||
if [[ ! -d minetest/worlds/$world_name ]]; then
|
||||
mkdir -p minetest/worlds/$world_name
|
||||
if [[ -n $pg_dbname ]]; then
|
||||
createdb $pg_dbname
|
||||
createdb players-$pg_dbname
|
||||
fi
|
||||
|
||||
ln -s $(pwd)/world.mt minetest/worlds/nalc/world.mt
|
||||
ln -s $(pwd)/world.mt minetest/worlds/$world_name/world.mt
|
||||
fi
|
||||
}
|
||||
|
||||
install_mods() {
|
||||
if [[ $ver == "0.4" ]]; then
|
||||
local i=0
|
||||
local md[1]="" # Mods to disable
|
||||
for mod in 3d_armor_ip 3d_armor_sfinv mysql_auth watershed mobs_old magicmithril blackmithril hardenedleather reinforcedleather obsidian eventobjects player_inactive random_messages irc irc_commands profilerdumper profnsched; do
|
||||
i=$(( $i+1 ))
|
||||
md[$i]=$mod
|
||||
done
|
||||
# if [[ $ver == "0.4" ]]; then
|
||||
# local i=0
|
||||
# local md[1]="" # Mods to disable
|
||||
# for mod in 3d_armor_ip 3d_armor_sfinv mysql_auth watershed mobs_old magicmithril blackmithril hardenedleather reinforcedleather obsidian eventobjects player_inactive random_messages irc irc_commands profilerdumper profnsched; do
|
||||
# i=$(( $i+1 ))
|
||||
# md[$i]=$mod
|
||||
# done
|
||||
#
|
||||
# if [[ -d minetest/mods ]]; then
|
||||
# rm -rf minetest/mods
|
||||
# ln -s $(pwd)/server-0.4/mods minetest/mods
|
||||
# fi
|
||||
#
|
||||
# if [[ -a world.mt && -z $pg_dbname ]]; then
|
||||
# rm world.mt
|
||||
# cp worldmt.conf world.mt
|
||||
# fi
|
||||
#
|
||||
# ls server-0.4/mods | while read -r mod; do
|
||||
# if [[ -a server-0.4/mods/$mod/modpack.txt ]]; then
|
||||
# ls server-0.4/mods/$mod | while read -r submod; do
|
||||
# if [[ -d server-0.4/mods/$mod/$submod ]]; then
|
||||
# local mod_enable="true"
|
||||
# for (( modn=1; modn<=$i; modn++ )); do
|
||||
# if [[ ${md[$modn]} == $submod ]]; then
|
||||
# mod_enable="false"
|
||||
# fi
|
||||
# done
|
||||
# echo "load_mod_$submod = $mod_enable" >> world.mt
|
||||
# if [[ $mod_enable == "true" && -d custom/textures/$submod ]]; then
|
||||
# cp custom/textures/$submod/* server-0.4/mods/$mod/$submod/textures/
|
||||
# fi
|
||||
# fi
|
||||
# done
|
||||
# else
|
||||
# local mod_enable="true"
|
||||
# for (( modn=1; modn<=$i; modn++ )); do
|
||||
# if [[ ${md[$modn]} == $mod ]]; then
|
||||
# mod_enable="false"
|
||||
# fi
|
||||
# done
|
||||
# echo "load_mod_$mod = $mod_enable" >> world.mt
|
||||
# if [[ $mod_enable == "true" && -d custom/textures/$mod ]]; then
|
||||
# cp custom/textures/$submod/* server-0.4/mods/$mod/textures/
|
||||
# fi
|
||||
# fi
|
||||
# done
|
||||
|
||||
if [[ -d minetest/mods ]]; then
|
||||
rm -rf minetest/mods
|
||||
ln -s $(pwd)/server-0.4/mods minetest/mods
|
||||
fi
|
||||
|
||||
if [[ -a world.mt && -z $pg_dbname ]]; then
|
||||
rm world.mt
|
||||
cp worldmt.conf world.mt
|
||||
fi
|
||||
|
||||
ls server-0.4/mods | while read -r mod; do
|
||||
if [[ -a server-0.4/mods/$mod/modpack.txt ]]; then
|
||||
ls server-0.4/mods/$mod | while read -r submod; do
|
||||
if [[ -d server-0.4/mods/$mod/$submod ]]; then
|
||||
local mod_enable="true"
|
||||
for (( modn=1; modn<=$i; modn++ )); do
|
||||
if [[ ${md[$modn]} == $submod ]]; then
|
||||
mod_enable="false"
|
||||
fi
|
||||
done
|
||||
echo "load_mod_$submod = $mod_enable" >> world.mt
|
||||
if [[ $mod_enable == "true" && -d custom/textures/$submod ]]; then
|
||||
cp custom/textures/$submod/* server-0.4/mods/$mod/$submod/textures/
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
local mod_enable="true"
|
||||
for (( modn=1; modn<=$i; modn++ )); do
|
||||
if [[ ${md[$modn]} == $mod ]]; then
|
||||
mod_enable="false"
|
||||
fi
|
||||
done
|
||||
echo "load_mod_$mod = $mod_enable" >> world.mt
|
||||
if [[ $mod_enable == "true" && -d custom/textures/$mod ]]; then
|
||||
cp custom/textures/$submod/* server-0.4/mods/$mod/textures/
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
if [[ -d nalc-server-mods ]]; then
|
||||
echo "Le dossier de mods est déjà présent. Que souhaitez-vous faire ?"
|
||||
read -p "Choisissez parmi la liste, ([1]update, [2]clean, [3]cancel, [4]Ne rien faire) : " continue
|
||||
if [[ $continue == 1 ]]; then
|
||||
cd nalc-server-mods
|
||||
git -c http.sslVerify=false pull
|
||||
git pull
|
||||
verif
|
||||
git -c http.sslVerify=false submodule update --init --recursive
|
||||
git submodule update --init --recursive
|
||||
verif
|
||||
cd ..
|
||||
elif [[ $continue == 2 ]]; then
|
||||
@ -298,10 +307,10 @@ install_mods() {
|
||||
fi
|
||||
|
||||
if [[ ! -d nalc-server-mods ]]; then
|
||||
git -c http.sslVerify=false clone $URL/nalc-server-mods.git
|
||||
git clone $URL/nalc-server-mods.git
|
||||
verif
|
||||
cd nalc-server-mods
|
||||
git -c http.sslVerify=false submodule update --init --recursive
|
||||
git submodule update --init --recursive
|
||||
cd ..
|
||||
fi
|
||||
|
||||
@ -322,6 +331,13 @@ install_mods() {
|
||||
done
|
||||
fi
|
||||
|
||||
local i=0
|
||||
local md[1]="" # Mods to disable
|
||||
for mod in 3d_armor_ip 3d_armor_sfinv nalc_lib worldedit_brush; do
|
||||
i=$(( $i+1 ))
|
||||
md[$i]=$mod
|
||||
done
|
||||
|
||||
ls nalc-server-mods | while read -r mod; do
|
||||
if [[ -d nalc-server-mods/$mod ]]; then
|
||||
ln -s $(pwd)/nalc-server-mods/$mod minetest/mods/$mod
|
||||
@ -329,26 +345,33 @@ install_mods() {
|
||||
if [[ -a nalc-server-mods/$mod/modpack.txt ]]; then
|
||||
ls nalc-server-mods/$mod | while read -r submod; do
|
||||
if [[ -d nalc-server-mods/$mod/$submod ]]; then
|
||||
echo "load_mod_$submod = true" >> world.mt
|
||||
local mod_enable="true"
|
||||
for (( modn=1; modn<=$i; modn++ )); do
|
||||
if [[ ${md[$modn]} == $submod ]]; then
|
||||
mod_enable="false"
|
||||
fi
|
||||
done
|
||||
echo "load_mod_$submod = $mod_enable" >> world.mt
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "load_mod_$mod = true" >> world.mt
|
||||
local mod_enable="true"
|
||||
for (( modn=1; modn<=$i; modn++ )); do
|
||||
if [[ ${md[$modn]} == $submod ]]; then
|
||||
mod_enable="false"
|
||||
fi
|
||||
done
|
||||
echo "load_mod_$mod = $mod_enable" >> world.mt
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Liens des mods créés dans minetest/mods/"
|
||||
fi
|
||||
}
|
||||
|
||||
post_install() {
|
||||
if [[ ! -a minetest/minetest.conf ]]; then
|
||||
if [[ $ver == "0.4" ]]; then
|
||||
cp server-0.4/minetest.conf minetest/minetest.conf
|
||||
else
|
||||
cp minetest.conf minetest/minetest.conf
|
||||
fi
|
||||
cp minetest-$ver.conf minetest/minetest.conf
|
||||
|
||||
echo "Veuillez éditer le fichier $(pwd)/minetest/minetest.conf"
|
||||
fi
|
||||
@ -357,25 +380,23 @@ post_install() {
|
||||
mkdir logs
|
||||
fi
|
||||
|
||||
if [[ $ver == "0.4" ]]; then
|
||||
if [[ ! -a start.sh ]]; then
|
||||
cp server-0.4/other_things/scripts/Server-side/script/start-mff.sh ./start.sh
|
||||
cp start.sh.example ./start.sh
|
||||
echo "Veuiller éditer le fichier start.sh"
|
||||
fi
|
||||
|
||||
# fix technic_worldgen crash
|
||||
cd server-0.4/mods/technic
|
||||
git checkout fb93388f06fe87ee75aaaf04cf6edcf01a26d981 technic_worldgen/oregen.lua
|
||||
cd ../../..
|
||||
echo "Fix technic_worldgen pour éviter crash appliqué."
|
||||
fi
|
||||
#cd server-0.4/mods/technic
|
||||
#git checkout fb93388f06fe87ee75aaaf04cf6edcf01a26d981 technic_worldgen/oregen.lua
|
||||
#cd ../../..
|
||||
#echo "Fix technic_worldgen pour éviter crash appliqué."
|
||||
|
||||
# skindb updater (à relancer à la main plusieurs fois pour l'instant)
|
||||
if [[ -d nalc-server-mods/skinsdb/updater ]]; then
|
||||
cd nalc-server-mods/skinsdb/updater
|
||||
./update_from_db.py
|
||||
cd ../../..
|
||||
fi
|
||||
#if [[ -d nalc-server-mods/skinsdb/updater ]]; then
|
||||
# cd nalc-server-mods/skinsdb/updater
|
||||
# ./update_from_db.py
|
||||
# cd ../../..
|
||||
#fi
|
||||
}
|
||||
|
||||
init() {
|
||||
@ -386,14 +407,14 @@ init() {
|
||||
elif [[ -n $url ]]; then
|
||||
URL=$url
|
||||
else
|
||||
URL="https://github.com/sys4-fr"
|
||||
URL="https://sys4.fr/gitea/nalc"
|
||||
fi
|
||||
|
||||
read -p "L'installation va démarrer. Continuer ? (y or n) : " continue
|
||||
if [[ $continue == "y" ]]; then
|
||||
if [[ $ver == "0.4" ]]; then
|
||||
install_0.4
|
||||
fi
|
||||
# if [[ $ver == "0.4" ]]; then
|
||||
# install_0.4
|
||||
# fi
|
||||
install_minetest
|
||||
install_minetest_game
|
||||
install_mods
|
||||
@ -407,10 +428,8 @@ init() {
|
||||
|
||||
action() {
|
||||
local arg=$(strip $1)
|
||||
if [[ $arg == "0.5" ]]; then
|
||||
init "0.5"
|
||||
elif [[ $arg == "0.4" ]]; then
|
||||
init "0.4"
|
||||
if [[ $arg == "5" || $arg == "0.4" || $arg == "master" ]]; then
|
||||
init $arg
|
||||
else
|
||||
error
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user