From d446131d93f3017fbfa2e438f620acecb6d57e01 Mon Sep 17 00:00:00 2001 From: BUISSON-DEBON Quentin Date: Wed, 2 Sep 2015 23:03:50 +0200 Subject: [PATCH] rewrite and improve all start/update/upgrade scripts --- .../Server-side/script/news-mff-rsync.sh | 0 .../Server-side/script/start-mff-hg.sh | 2 +- .../Server-side/script/start-mff-magichet.sh | 26 +++++++++ .../Server-side/script/start-mff-skyblock.sh | 26 +++++++++ .../scripts/Server-side/script/start-mff.sh | 0 .../upgrade-mff-hg/upgrade-part-mff-hg.sh | 53 +++++++------------ .../upgrade-mff-hg/w-upgrade-mff-hg.sh | 38 ++++++------- .../upgrade-part-mff-magichet.sh | 43 +++++++++++++++ .../w-upgrade-mff-magichet.sh | 44 +++++++++++++++ .../upgrade-part-mff-skyblock.sh | 43 +++++++++++++++ .../w-upgrade-mff-skyblock.sh | 44 +++++++++++++++ .../upgrade-mff/upgrade-part-mff.sh | 32 ++++++----- .../Server-side/upgrade-mff/w-upgrade-mff.sh | 22 +++----- 13 files changed, 284 insertions(+), 89 deletions(-) mode change 100755 => 100644 other_things/scripts/Server-side/script/news-mff-rsync.sh mode change 100755 => 100644 other_things/scripts/Server-side/script/start-mff-hg.sh create mode 100644 other_things/scripts/Server-side/script/start-mff-magichet.sh create mode 100644 other_things/scripts/Server-side/script/start-mff-skyblock.sh mode change 100755 => 100644 other_things/scripts/Server-side/script/start-mff.sh mode change 100755 => 100644 other_things/scripts/Server-side/upgrade-mff-hg/upgrade-part-mff-hg.sh mode change 100755 => 100644 other_things/scripts/Server-side/upgrade-mff-hg/w-upgrade-mff-hg.sh create mode 100644 other_things/scripts/Server-side/upgrade-mff-magichet/upgrade-part-mff-magichet.sh create mode 100644 other_things/scripts/Server-side/upgrade-mff-magichet/w-upgrade-mff-magichet.sh create mode 100644 other_things/scripts/Server-side/upgrade-mff-skyblock/upgrade-part-mff-skyblock.sh create mode 100644 other_things/scripts/Server-side/upgrade-mff-skyblock/w-upgrade-mff-skyblock.sh mode change 100755 => 100644 other_things/scripts/Server-side/upgrade-mff/upgrade-part-mff.sh mode change 100755 => 100644 other_things/scripts/Server-side/upgrade-mff/w-upgrade-mff.sh diff --git a/other_things/scripts/Server-side/script/news-mff-rsync.sh b/other_things/scripts/Server-side/script/news-mff-rsync.sh old mode 100755 new mode 100644 diff --git a/other_things/scripts/Server-side/script/start-mff-hg.sh b/other_things/scripts/Server-side/script/start-mff-hg.sh old mode 100755 new mode 100644 index 975886d1..c3204e6e --- a/other_things/scripts/Server-side/script/start-mff-hg.sh +++ b/other_things/scripts/Server-side/script/start-mff-hg.sh @@ -18,7 +18,7 @@ while true /home/quentinbd/mff-hg/bin/minetestserver \ --world /home/quentinbd/mff-hg/worlds/minetestforfun-hg/ \ --config /home/quentinbd/mff-hg/minetest.conf \ - --gameid hungry_games \ + --gameid Hungry Games \ --port 30042 \ # --logfile $DEBUG diff --git a/other_things/scripts/Server-side/script/start-mff-magichet.sh b/other_things/scripts/Server-side/script/start-mff-magichet.sh new file mode 100644 index 00000000..66cd5fbc --- /dev/null +++ b/other_things/scripts/Server-side/script/start-mff-magichet.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +DEBUG='/home/quentinbd/script/debug-mff-magichet.txt' +MOREDEBUG='/home/quentinbd/script/moredebug-mff-megichet.txt' + +cd /home/quentinbd/mff-hg + +while true + do + sleep 5 + + echo "----------------------" >>$MOREDEBUG + echo "Server restarted at "`date` >>$MOREDEBUG + echo "----------------------" >>$MOREDEBUG + + echo "0" >/tmp/players_c.txt + + /home/quentinbd/mff-magichet/bin/minetestserver \ + --world /home/quentinbd/mff-magichet/worlds/minetestforfun-magichet/ \ + --config /home/quentinbd/mff-magichet/minetest.conf \ + --gameid Magichet \ + --port 30091 \ +# --logfile $DEBUG + + sleep 25 +done &>> $MOREDEBUG diff --git a/other_things/scripts/Server-side/script/start-mff-skyblock.sh b/other_things/scripts/Server-side/script/start-mff-skyblock.sh new file mode 100644 index 00000000..ff86c8e1 --- /dev/null +++ b/other_things/scripts/Server-side/script/start-mff-skyblock.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +DEBUG='/home/quentinbd/script/debug-mff-skyblock.txt' +MOREDEBUG='/home/quentinbd/script/moredebug-mff-skyblock.txt' + +cd /home/quentinbd/mff-skyblock + +while true + do + sleep 5 + + echo "----------------------" >>$MOREDEBUG + echo "Server restarted at "`date` >>$MOREDEBUG + echo "----------------------" >>$MOREDEBUG + + echo "0" >/tmp/players_c.txt + + /home/quentinbd/mff-skyblock/bin/minetestserver \ + --world /home/quentinbd/mff-skyblock/worlds/minetestforfun-skyblock/ \ + --config /home/quentinbd/mff-skyblock/minetest.conf \ + --gameid Skyblock \ + --port 30052 \ +# --logfile $DEBUG + + sleep 25 +done &>> $MOREDEBUG diff --git a/other_things/scripts/Server-side/script/start-mff.sh b/other_things/scripts/Server-side/script/start-mff.sh old mode 100755 new mode 100644 diff --git a/other_things/scripts/Server-side/upgrade-mff-hg/upgrade-part-mff-hg.sh b/other_things/scripts/Server-side/upgrade-mff-hg/upgrade-part-mff-hg.sh old mode 100755 new mode 100644 index cad8d9c3..be087a51 --- a/other_things/scripts/Server-side/upgrade-mff-hg/upgrade-part-mff-hg.sh +++ b/other_things/scripts/Server-side/upgrade-mff-hg/upgrade-part-mff-hg.sh @@ -1,57 +1,44 @@ # on récupère la dernière version du jeu cd /home/quentinbd/ git clone https://github.com/MinetestForFun/server-minetestforfun-hungry_games.git -echo "Clone de minetest-minetestforfun-server réussit." +echo "Clone de server-minetestforfun-hungry_games réussit." cd /home/quentinbd/server-minetestforfun-hungry_games/ git submodule update --init --recursive -# on sauvegarde l'ancien subgame mff-hg -rm -Rf /home/quentinbd/upgrade-mff-hg/olds-part/subgame/ -echo "Ancienne sauvegarde du subgame correctement supprimée." +# On sauvegarde les anciens ../games et ../mods +rm -R /home/quentinbd/upgrade-mff-hg/olds-part/games/ +rm -R /home/quentinbd/upgrade-mff-hg/olds-part/mods/ +echo "Ancienne sauvegarde de /mods et /games correctement supprimée." -cp -R /home/quentinbd/mff-hg/games /home/quentinbd/upgrade-mff-hg/olds-part/subgame/ -echo "Sauvegarde du subgame correctement effectuée." +cp -R /home/quentinbd/mff-hg/mods/ /home/quentinbd/upgrade-mff-hg/olds-part/ +cp -R /home/quentinbd/mff-hg/games/ /home/quentinbd/upgrade-mff-hg/olds-part/ +echo "Sauvegarde de /mods et /games correctement effectuée." -# on MAJ le novueau subgame -rm -Rf /home/quentinbd/mff-hg/games/ +# On MAJ les nouveaux minetest/games et minetest/mods +rm -R /home/quentinbd/mff-hg/games/ +rm -R /home/quentinbd/mff-hg/mods/ mkdir /home/quentinbd/mff-hg/games/ -cp -R /home/quentinbd/server-minetestforfun-hungry_games/ /home/quentinbd/mff-hg/games/ -echo "Nouveau subgame correctement déplacé." +cp -R /home/quentinbd/server-minetestforfun-hungry_games/hungry_game/ /home/quentinbd/mff/games/ +cp -R /home/quentinbd/server-minetestforfun-hungry_games/mods/ /home/quentinbd/mff/ +echo "Nouveaux /mods et /games correctement déplacés" -# on MAJ le random_messages et le world.mt -#rm /home/quentinbd/mff/worlds/minetestforfun/news.txt -#rm /home/quentinbd/mff/worlds/minetestforfun/random_messages +# On MAJ le minetest.conf, world.mt, random_messages et le top_config.txt mkdir /home/quentinbd/mff-hg/worlds/minetestforfun-hg/ -rm /home/quentinbd/mff-hg/games/hungry_games/worlds/minetestforfun-hg/random_messages -rm /home/quentinbd/mff-hg/games/hungry_games/worlds/minetestforfun-hg/world.mt rm /home/quentinbd/mff-hg/minetest.conf +rm /home/quentinbd/mff-hg/games/hungry_games/worlds/minetestforfun-hg/world.mt +rm /home/quentinbd/mff-hg/games/hungry_games/worlds/minetestforfun-hg/random_messages rm /home/quentinbd/mff-hg/games/hungry_games/worlds/minetestforfun-hg/top_config.txt -#cp /home/quentinbd/server-minetestforfun-hungry_games/worlds/minetestforfun/news.txt /home/quentinbd/mff/worlds/minetestforfun/ -cp /home/quentinbd/server-minetestforfun-hungry_games/worlds/minetestforfun-hg/random_messages /home/quentinbd/mff-hg/games/hungry_games/worlds/minetestforfun-hg/ -cp /home/quentinbd/server-minetestforfun-hungry_games/worlds/minetestforfun-hg/world.mt /home/quentinbd/mff-hg/games/hungry_games/worlds/minetestforfun-hg/ +# On les remet cp /home/quentinbd/server-minetestforfun-hungry_games/minetest.conf /home/quentinbd/mff-hg/ +cp /home/quentinbd/server-minetestforfun-hungry_games/worlds/minetestforfun-hg/world.mt /home/quentinbd/mff-hg/games/hungry_games/worlds/minetestforfun-hg/ +cp /home/quentinbd/server-minetestforfun-hungry_games/worlds/minetestforfun-hg/random_messages /home/quentinbd/mff-hg/games/hungry_games/worlds/minetestforfun-hg/ cp /home/quentinbd/server-minetestforfun-hungry_games/worlds/minetestforfun-hg/top_config.txt /home/quentinbd/mff-hg/games/hungry_games/worlds/minetestforfun-hg/ - echo "Nouveau 'random_messages/world.mt/minetest.conf/top_config.txt' correctement déplacé" # Suppression du dossier cloné rm -Rf /home/quentinbd/server-minetestforfun-hungry_games/ echo "Bravo ! mff-hg/mods et mff-hg/games maintenant à jour" -# TEMPORAIRE - ré-ajout de l'ancien mod irc -#rm -R /home/quentinbd/mff-hg/games/hungry_games/mods/irc/ -#rm -R /home/quentinbd/mff-hg/games/hungry_games/mods/irc_commands/ -#echo "TEMPORAIRE - Suppression de l'irc car crash" -#cp -R /home/quentinbd/upgrade-mff/irc-old-save/ /home/quentinbd/mff-hg/games/hungry_games/mods/ -#mv /home/quentinbd/mff-hg/games/hungry_games/mods/irc-old-save/ /home/quentinbd/mff-hg/games/hungry_games/mods/irc/ -#echo "TEMPORAIRE - ré-ajout de l'ancien mod irc" - -# TEMPORAIRE - ré-ajout de l'ancien mod throwing -#rm -R /home/quentinbd/minetest/mods/throwing/ -#cp -R /home/quentinbd/upgrade/throwing-old-save/ /home/quentinbd/minetest/mods/ -#mv /home/quentinbd/minetest/mods/throwing-old-save/ /home/quentinbd/minetest/mods/throwing/ -#echo "TEMPORAIRE - ré-ajout de l'ancien mod throwing" - # On ré-attribut les droits à quentinbd et en 755 chown -R quentinbd:quentinbd /home/quentinbd/mff-hg/ chmod -R 755 /home/quentinbd/mff-hg/ diff --git a/other_things/scripts/Server-side/upgrade-mff-hg/w-upgrade-mff-hg.sh b/other_things/scripts/Server-side/upgrade-mff-hg/w-upgrade-mff-hg.sh old mode 100755 new mode 100644 index 984be548..e40d0a88 --- a/other_things/scripts/Server-side/upgrade-mff-hg/w-upgrade-mff-hg.sh +++ b/other_things/scripts/Server-side/upgrade-mff-hg/w-upgrade-mff-hg.sh @@ -1,49 +1,43 @@ # passer sur branche master ou stable github cd /home/quentinbd/mff-hg/ -#git checkout master -git checkout stable-0.4 # Suppression des anciens fichiers -#rm -Rv /home/quentinbd/upgrade-mff/olds -#rm -Rv /home/quentinbd/upgrade-mff/mff.tar.gz +rm -Rv /home/quentinbd/upgrade-mff-hg/olds +rm -Rv /home/quentinbd/upgrade-mff-hg/mff-hg.tar.gz # Sauvegarde des fichiers critiques -#cp -Rv /home/quentinbd/mff-hg/games/minetestforfun_game/ /home/quentinbd/upgrade-mff/olds/ -#cp -Rv /home/quentinbd/mff-hg/mods/ /home/quentinbd/upgrade-mff/olds/ +cp -Rv /home/quentinbd/mff-hg/games/minetestforfun_game/ /home/quentinbd/upgrade-mff-hg/olds/ +cp -Rv /home/quentinbd/mff-hg/mods/ /home/quentinbd/upgrade-mff-hg/olds/ cp -Rv /home/quentinbd/mff-hg/worlds/ /home/quentinbd/upgrade-mff-hg/olds/ cp /home/quentinbd/mff-hg/minetest.conf /home/quentinbd/upgrade-mff-hg/olds/ # Sauvegarde et compression du dossier minetest (au cas ou) -#cd /home/quentinbd/upgrade-mff/ -#tar -cf mff.tar.gz /home/quentinbd/mff-hg/ +cd /home/quentinbd/upgrade-mff-hg/ +tar -cf mff-hg.tar.gz /home/quentinbd/mff-hg/ # Suppression de minetest rm -Rv /home/quentinbd/mff-hg/ # Réinstallaton de minetest cd /home/quentinbd/ -#git clone https://github.com/minetest/minetest.git -# DEBUT - Utilisation de la version 0.4 stable -git clone https://github.com/minetest/minetest.git -mv /home/quentinbd/minetest/ /home/quentinbd/mff-hg/ +# DEBUT - Utilisation de la dernière version 0.4 stable +wget https://codeload.github.com/minetest/minetest/zip/stable-0.4 +unzip /home/quentinbd/stable-0.4 +mv /home/quentinbd/minetest-stable-0.4/ /home/quentinbd/mff-hg/ +rm -v /home/quentinbd/stable-0.4 # FIN - Utilisation de la version 0.4 stable -#cd /home/quentinbd/mff-hg/games/ -#git clone https://github.com/minetest/minetest_game.git # Compilation cd /home/quentinbd/mff-hg/ -# build sqlite3 +# build SQLITE3 cmake . -DBUILD_CLIENT=0 -DBUILD_SERVER=1 -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LUAJIT=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr make -j$(grep -c processor /proc/cpuinfo) -# build redis + irc -#cmake . -DENABLE_REDIS=1 -DRUN_RUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr -#make -j$(grep -c processor /proc/cpuinfo) # Ajout des fichiers critiques au nouveau dossier minetest -#cp -Rv /home/quentinbd/upgrade-mff/olds/minetestforfun_game/ /home/quentinbd/mff-hg/games/ -#cp -Rv /home/quentinbd/upgrade-mff/olds/mods/ /home/quentinbd/mff-hg/ -cp -Rv /home/quentinbd/upgrade-mff/olds/worlds/ /home/quentinbd/mff-hg/ -cp /home/quentinbd/upgrade-mff/olds/minetest.conf /home/quentinbd/mff-hg/ +cp -Rv /home/quentinbd/upgrade-mff-hg/olds/minetestforfun_game/ /home/quentinbd/mff-hg/games/ +cp -Rv /home/quentinbd/upgrade-mff-hg/olds/mods/ /home/quentinbd/mff-hg/ +cp -Rv /home/quentinbd/upgrade-mff-hg/olds/worlds/ /home/quentinbd/mff-hg/ +cp /home/quentinbd/upgrade-mff-hg/olds/minetest.conf /home/quentinbd/mff-hg/ # Donne les droits à quentinbd chmod -R 755 /home/quentinbd/mff-hg/ diff --git a/other_things/scripts/Server-side/upgrade-mff-magichet/upgrade-part-mff-magichet.sh b/other_things/scripts/Server-side/upgrade-mff-magichet/upgrade-part-mff-magichet.sh new file mode 100644 index 00000000..623951ec --- /dev/null +++ b/other_things/scripts/Server-side/upgrade-mff-magichet/upgrade-part-mff-magichet.sh @@ -0,0 +1,43 @@ +# on récupère la dernière version du jeu +cd /home/quentinbd/ +git clone https://github.com/MinetestForFun/server-minetestforfun-magichet.git +echo "Clone de server-minetestforfun-magichet réussit." +cd /home/quentinbd/server-minetestforfun-magichet/ +git submodule update --init --recursive + +# On sauvegarde les anciens ../games et ../mods +rm -R /home/quentinbd/upgrade-mff-magichet/olds-part/games/ +rm -R /home/quentinbd/upgrade-mff-magichet/olds-part/mods/ +echo "Ancienne sauvegarde de /mods et /games correctement supprimée." + +cp -R /home/quentinbd/mff-magichet/mods/ /home/quentinbd/upgrade-mff-magichet/olds-part/ +cp -R /home/quentinbd/mff-magichet/games/ /home/quentinbd/upgrade-mff-magichet/olds-part/ +echo "Sauvegarde de /mods et /games correctement effectuée." + +# On MAJ les nouveaux minetest/games et minetest/mods +rm -R /home/quentinbd/mff-magichet/games/ +rm -R /home/quentinbd/mff-magichet/mods/ +mkdir /home/quentinbd/mff-magichet/games/ +cp -R /home/quentinbd/server-minetestforfun-magichet/hungry_game/ /home/quentinbd/mff/games/ +cp -R /home/quentinbd/server-minetestforfun-magichet/mods/ /home/quentinbd/mff/ +echo "Nouveaux /mods et /games correctement déplacés" + +# On MAJ le minetest.conf, world.mt, et le random_messages +mkdir /home/quentinbd/mff-magichet/worlds/minetestforfun-magichet/ +rm /home/quentinbd/mff-magichet/minetest.conf +rm /home/quentinbd/mff-magichet/games/hungry_games/worlds/minetestforfun-magichet/world.mt +rm /home/quentinbd/mff-magichet/games/hungry_games/worlds/minetestforfun-magichet/random_messages +# On les remet +cp /home/quentinbd/server-minetestforfun-magichet/minetest.conf /home/quentinbd/mff-magichet/ +cp /home/quentinbd/server-minetestforfun-magichet/worlds/minetestforfun-magichet/world.mt /home/quentinbd/mff-magichet/games/hungry_games/worlds/minetestforfun-magichet/ +cp /home/quentinbd/server-minetestforfun-magichet/worlds/minetestforfun-magichet/random_messages /home/quentinbd/mff-magichet/games/hungry_games/worlds/minetestforfun-magichet/ +echo "Nouveau 'random_messages/world.mt/minetest.conf/top_config.txt' correctement déplacé" + +# Suppression du dossier cloné +rm -Rf /home/quentinbd/server-minetestforfun-magichet/ +echo "Bravo ! mff-magichet/mods et mff-magichet/games maintenant à jour" + +# On ré-attribut les droits à quentinbd et en 755 +chown -R quentinbd:quentinbd /home/quentinbd/mff-magichet/ +chmod -R 755 /home/quentinbd/mff-magichet/ +echo "ré-attribution des droits à quentinbd:quentinbd" diff --git a/other_things/scripts/Server-side/upgrade-mff-magichet/w-upgrade-mff-magichet.sh b/other_things/scripts/Server-side/upgrade-mff-magichet/w-upgrade-mff-magichet.sh new file mode 100644 index 00000000..87ab1dd7 --- /dev/null +++ b/other_things/scripts/Server-side/upgrade-mff-magichet/w-upgrade-mff-magichet.sh @@ -0,0 +1,44 @@ +# passer sur branche master ou stable github +cd /home/quentinbd/mff-magichet/ + +# Suppression des anciens fichiers +rm -Rv /home/quentinbd/upgrade-mff-magichet/olds +rm -Rv /home/quentinbd/upgrade-mff-magichet/mff-magichet.tar.gz + +# Sauvegarde des fichiers critiques +cp -Rv /home/quentinbd/mff-magichet/games/minetestforfun_game/ /home/quentinbd/upgrade-mff-magichet/olds/ +cp -Rv /home/quentinbd/mff-magichet/mods/ /home/quentinbd/upgrade-mff-magichet/olds/ +cp -Rv /home/quentinbd/mff-magichet/worlds/ /home/quentinbd/upgrade-mff-magichet/olds/ +cp /home/quentinbd/mff-magichet/minetest.conf /home/quentinbd/upgrade-mff-magichet/olds/ + +# Sauvegarde et compression du dossier minetest (au cas ou) +cd /home/quentinbd/upgrade-mff-magichet/ +tar -cf mff-magichet.tar.gz /home/quentinbd/mff-magichet/ + +# Suppression de minetest +rm -Rv /home/quentinbd/mff-magichet/ + +# Réinstallaton de minetest +cd /home/quentinbd/ +# DEBUT - Utilisation de la dernière version 0.4 stable +wget https://codeload.github.com/minetest/minetest/zip/stable-0.4 +unzip /home/quentinbd/stable-0.4 +mv /home/quentinbd/minetest-stable-0.4/ /home/quentinbd/mff-magichet/ +rm -v /home/quentinbd/stable-0.4 +# FIN - Utilisation de la version 0.4 stable + +# Compilation +cd /home/quentinbd/mff-magichet/ +# build SQLITE3 +cmake . -DBUILD_CLIENT=0 -DBUILD_SERVER=1 -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LUAJIT=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr +make -j$(grep -c processor /proc/cpuinfo) + +# Ajout des fichiers critiques au nouveau dossier minetest +cp -Rv /home/quentinbd/upgrade-mff-magichet/olds/minetestforfun_game/ /home/quentinbd/mff-magichet/games/ +cp -Rv /home/quentinbd/upgrade-mff-magichet/olds/mods/ /home/quentinbd/mff-magichet/ +cp -Rv /home/quentinbd/upgrade-mff-magichet/olds/worlds/ /home/quentinbd/mff-magichet/ +cp /home/quentinbd/upgrade-mff-magichet/olds/minetest.conf /home/quentinbd/mff-magichet/ + +# Donne les droits à quentinbd +chmod -R 755 /home/quentinbd/mff-magichet/ +chown -R quentinbd:quentinbd /home/quentinbd/mff-magichet/ diff --git a/other_things/scripts/Server-side/upgrade-mff-skyblock/upgrade-part-mff-skyblock.sh b/other_things/scripts/Server-side/upgrade-mff-skyblock/upgrade-part-mff-skyblock.sh new file mode 100644 index 00000000..6b9876f6 --- /dev/null +++ b/other_things/scripts/Server-side/upgrade-mff-skyblock/upgrade-part-mff-skyblock.sh @@ -0,0 +1,43 @@ +# on récupère la dernière version du jeu +cd /home/quentinbd/ +git clone https://github.com/MinetestForFun/server-minetestforfun-skyblock.git +echo "Clone de server-minetestforfun-skyblock réussit." +cd /home/quentinbd/server-minetestforfun-skyblock/ +git submodule update --init --recursive + +# On sauvegarde les anciens ../games et ../mods +rm -R /home/quentinbd/upgrade-mff-skyblock/olds-part/games/ +rm -R /home/quentinbd/upgrade-mff-skyblock/olds-part/mods/ +echo "Ancienne sauvegarde de /mods et /games correctement supprimée." + +cp -R /home/quentinbd/mff-skyblock/mods/ /home/quentinbd/upgrade-mff-skyblock/olds-part/ +cp -R /home/quentinbd/mff-skyblock/games/ /home/quentinbd/upgrade-mff-skyblock/olds-part/ +echo "Sauvegarde de /mods et /games correctement effectuée." + +# On MAJ les nouveaux minetest/games et minetest/mods +rm -R /home/quentinbd/mff-skyblock/games/ +rm -R /home/quentinbd/mff-skyblock/mods/ +mkdir /home/quentinbd/mff-skyblock/games/ +cp -R /home/quentinbd/server-minetestforfun-skyblock/hungry_game/ /home/quentinbd/mff/games/ +cp -R /home/quentinbd/server-minetestforfun-skyblock/mods/ /home/quentinbd/mff/ +echo "Nouveaux /mods et /games correctement déplacés" + +# On MAJ le minetest.conf, world.mt, et le random_messages +mkdir /home/quentinbd/mff-skyblock/worlds/minetestforfun-skyblock/ +rm /home/quentinbd/mff-skyblock/minetest.conf +rm /home/quentinbd/mff-skyblock/games/hungry_games/worlds/minetestforfun-skyblock/world.mt +rm /home/quentinbd/mff-skyblock/games/hungry_games/worlds/minetestforfun-skyblock/random_messages +# On les remet +cp /home/quentinbd/server-minetestforfun-skyblock/minetest.conf /home/quentinbd/mff-skyblock/ +cp /home/quentinbd/server-minetestforfun-skyblock/worlds/minetestforfun-skyblock/world.mt /home/quentinbd/mff-skyblock/games/hungry_games/worlds/minetestforfun-skyblock/ +cp /home/quentinbd/server-minetestforfun-skyblock/worlds/minetestforfun-skyblock/random_messages /home/quentinbd/mff-skyblock/games/hungry_games/worlds/minetestforfun-skyblock/ +echo "Nouveau 'random_messages/world.mt/minetest.conf/top_config.txt' correctement déplacé" + +# Suppression du dossier cloné +rm -Rf /home/quentinbd/server-minetestforfun-skyblock/ +echo "Bravo ! mff-skyblock/mods et mff-skyblock/games maintenant à jour" + +# On ré-attribut les droits à quentinbd et en 755 +chown -R quentinbd:quentinbd /home/quentinbd/mff-skyblock/ +chmod -R 755 /home/quentinbd/mff-skyblock/ +echo "ré-attribution des droits à quentinbd:quentinbd" diff --git a/other_things/scripts/Server-side/upgrade-mff-skyblock/w-upgrade-mff-skyblock.sh b/other_things/scripts/Server-side/upgrade-mff-skyblock/w-upgrade-mff-skyblock.sh new file mode 100644 index 00000000..20780214 --- /dev/null +++ b/other_things/scripts/Server-side/upgrade-mff-skyblock/w-upgrade-mff-skyblock.sh @@ -0,0 +1,44 @@ +# passer sur branche master ou stable github +cd /home/quentinbd/mff-skyblock/ + +# Suppression des anciens fichiers +rm -Rv /home/quentinbd/upgrade-mff-skyblock/olds +rm -Rv /home/quentinbd/upgrade-mff-skyblock/mff-skyblock.tar.gz + +# Sauvegarde des fichiers critiques +cp -Rv /home/quentinbd/mff-skyblock/games/minetestforfun_game/ /home/quentinbd/upgrade-mff-skyblock/olds/ +cp -Rv /home/quentinbd/mff-skyblock/mods/ /home/quentinbd/upgrade-mff-skyblock/olds/ +cp -Rv /home/quentinbd/mff-skyblock/worlds/ /home/quentinbd/upgrade-mff-skyblock/olds/ +cp /home/quentinbd/mff-skyblock/minetest.conf /home/quentinbd/upgrade-mff-skyblock/olds/ + +# Sauvegarde et compression du dossier minetest (au cas ou) +cd /home/quentinbd/upgrade-mff-skyblock/ +tar -cf mff-skyblock.tar.gz /home/quentinbd/mff-skyblock/ + +# Suppression de minetest +rm -Rv /home/quentinbd/mff-skyblock/ + +# Réinstallaton de minetest +cd /home/quentinbd/ +# DEBUT - Utilisation de la dernière version 0.4 stable +wget https://codeload.github.com/minetest/minetest/zip/stable-0.4 +unzip /home/quentinbd/stable-0.4 +mv /home/quentinbd/minetest-stable-0.4/ /home/quentinbd/mff-skyblock/ +rm -v /home/quentinbd/stable-0.4 +# FIN - Utilisation de la version 0.4 stable + +# Compilation +cd /home/quentinbd/mff-skyblock/ +# build SQLITE3 +cmake . -DBUILD_CLIENT=0 -DBUILD_SERVER=1 -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LUAJIT=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr +make -j$(grep -c processor /proc/cpuinfo) + +# Ajout des fichiers critiques au nouveau dossier minetest +cp -Rv /home/quentinbd/upgrade-mff-skyblock/olds/minetestforfun_game/ /home/quentinbd/mff-skyblock/games/ +cp -Rv /home/quentinbd/upgrade-mff-skyblock/olds/mods/ /home/quentinbd/mff-skyblock/ +cp -Rv /home/quentinbd/upgrade-mff-skyblock/olds/worlds/ /home/quentinbd/mff-skyblock/ +cp /home/quentinbd/upgrade-mff-skyblock/olds/minetest.conf /home/quentinbd/mff-skyblock/ + +# Donne les droits à quentinbd +chmod -R 755 /home/quentinbd/mff-skyblock/ +chown -R quentinbd:quentinbd /home/quentinbd/mff-skyblock/ diff --git a/other_things/scripts/Server-side/upgrade-mff/upgrade-part-mff.sh b/other_things/scripts/Server-side/upgrade-mff/upgrade-part-mff.sh old mode 100755 new mode 100644 index 8a46da62..6c0e7323 --- a/other_things/scripts/Server-side/upgrade-mff/upgrade-part-mff.sh +++ b/other_things/scripts/Server-side/upgrade-mff/upgrade-part-mff.sh @@ -1,11 +1,11 @@ -# on récupère la dernière version du jeu +# On récupère la dernière version du jeu cd /home/quentinbd/ git clone https://github.com/MinetestForFun/server-minetestforfun.git echo "Clone de server-minetestforfun réussit." cd /home/quentinbd/server-minetestforfun/ git submodule update --init --recursive -# on sauvegarde les anciens minetest/games et minetest/mods +# On sauvegarde les anciens ../games et ../mods rm -R /home/quentinbd/upgrade-mff/olds-part/games/ rm -R /home/quentinbd/upgrade-mff/olds-part/mods/ echo "Ancienne sauvegarde de /mods et /games correctement supprimée." @@ -14,7 +14,7 @@ cp -R /home/quentinbd/mff/mods/ /home/quentinbd/upgrade-mff/olds-part/ cp -R /home/quentinbd/mff/games/ /home/quentinbd/upgrade-mff/olds-part/ echo "Sauvegarde de /mods et /games correctement effectuée." -# on MAJ les nouveaux minetest/games et minetest/mods +# On MAJ les nouveaux minetest/games et minetest/mods rm -R /home/quentinbd/mff/games/ rm -R /home/quentinbd/mff/mods/ mkdir /home/quentinbd/mff/games/ @@ -22,18 +22,22 @@ cp -R /home/quentinbd/server-minetestforfun/minetestforfun_game/ /home/quentinbd cp -R /home/quentinbd/server-minetestforfun/mods/ /home/quentinbd/mff/ echo "Nouveaux /mods et /games correctement déplacés" -# on MAJ les news, random_messages et le world.mt -rm /home/quentinbd/mff/worlds/minetestforfun/news.txt -rm /home/quentinbd/mff/worlds/minetestforfun/random_messages +# On MAJ le minetest.conf, world.mt, random_messages et le news.txt +mkdir /home/quentinbd/mff/worlds/minetestforfun/ +rm /home/quentinbd/mff-hg/minetest.conf rm /home/quentinbd/mff/worlds/minetestforfun/world.mt -cp /home/quentinbd/server-minetestforfun/worlds/minetestforfun/news.txt /home/quentinbd/mff/worlds/minetestforfun/ -cp /home/quentinbd/server-minetestforfun/worlds/minetestforfun/random_messages /home/quentinbd/mff/worlds/minetestforfun/ +rm /home/quentinbd/mff/worlds/minetestforfun/random_messages +rm /home/quentinbd/mff/worlds/minetestforfun/news.txt +# On les remet +cp /home/quentinbd/server-minetestforfun/minetest.conf /home/quentinbd/mff/ cp /home/quentinbd/server-minetestforfun/worlds/minetestforfun/world.mt /home/quentinbd/mff/worlds/minetestforfun/ +cp /home/quentinbd/server-minetestforfun/worlds/minetestforfun/random_messages /home/quentinbd/mff/worlds/minetestforfun/ +cp /home/quentinbd/server-minetestforfun/worlds/minetestforfun/news.txt /home/quentinbd/mff/worlds/minetestforfun/ echo "Nouvelles news.txt, world.mt et random_messages correctement déplacé" # Suppression du dossier cloné rm -Rf /home/quentinbd/server-minetestforfun/ -echo "Bravo ! minetest/mods et minetest/games maintenant à jour" +echo "Bravo ! mff/mods et mff/games maintenant à jour" # TEMPORAIRE - ré-ajout de l'ancien mod irc rm -R /home/quentinbd/mff/mods/irc/ @@ -41,13 +45,7 @@ cp -R /home/quentinbd/upgrade-mff/irc-old-save/ /home/quentinbd/mff/mods/ mv /home/quentinbd/mff/mods/irc-old-save/ /home/quentinbd/mff/mods/irc/ echo "TEMPORAIRE - ré-ajout de l'ancien mod irc" -# TEMPORAIRE - ré-ajout de l'ancien mod throwing -#rm -R /home/quentinbd/minetest/mods/throwing/ -#cp -R /home/quentinbd/upgrade/throwing-old-save/ /home/quentinbd/minetest/mods/ -#mv /home/quentinbd/minetest/mods/throwing-old-save/ /home/quentinbd/minetest/mods/throwing/ -#echo "TEMPORAIRE - ré-ajout de l'ancien mod throwing" - # On ré-attribut les droits à quentinbd et en 755 -chown -R quentinbd:quentinbd /home/quentinbd/ -chmod -R 755 /home/quentinbd/ +chown -R quentinbd:quentinbd /home/quentinbd/mff/ +chmod -R 755 /home/quentinbd/mff/ echo "ré-attribution des droits à quentinbd:quentinbd" diff --git a/other_things/scripts/Server-side/upgrade-mff/w-upgrade-mff.sh b/other_things/scripts/Server-side/upgrade-mff/w-upgrade-mff.sh old mode 100755 new mode 100644 index 1cf2ae09..47f79661 --- a/other_things/scripts/Server-side/upgrade-mff/w-upgrade-mff.sh +++ b/other_things/scripts/Server-side/upgrade-mff/w-upgrade-mff.sh @@ -1,7 +1,5 @@ # passer sur branche master ou stable github cd /home/quentinbd/mff/ -#git checkout master -git checkout stable-0.4 # Suppression des anciens fichiers rm -Rv /home/quentinbd/upgrade-mff/olds @@ -22,25 +20,16 @@ rm -Rv /home/quentinbd/mff/ # Réinstallaton de minetest cd /home/quentinbd/ -#git clone https://github.com/minetest/minetest.git # DEBUT - Utilisation de la dernière version 0.4 stable -git clone https://github.com/minetest/minetest.git -#unzip /home/quentinbd/minetest-stable-0.4.zip -#mv /home/quentinbd/minetest-stable-0.4/ /home/quentinbd/mff/ -mv /home/quentinbd/minetest/ /home/quentinbd/mff/ +wget https://codeload.github.com/minetest/minetest/zip/stable-0.4 +unzip /home/quentinbd/stable-0.4 +mv /home/quentinbd/minetest-stable-0.4/ /home/quentinbd/mff/ +rm -v /home/quentinbd/stable-0.4 # FIN - Utilisation de la version 0.4 stable -cd /home/quentinbd/mff/games/ -git clone https://github.com/minetest/minetest_game.git # Compilation cd /home/quentinbd/mff/ -# build sqlite3 -#cmake . -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -#make -j$(grep -c processor /proc/cpuinfo) -# build redis -#cmake . -DENABLE_REDIS=1 -DRUN_RUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -#make -j$(grep -c processor /proc/cpuinfo) -# build redis + irc +# Build REDIS + IRC cmake . -DBUILD_CLIENT=0 -DBUILD_SERVER=1 -DENABLE_REDIS=1 -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LUAJIT=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DENABLE_CURL=1 make -j$(grep -c processor /proc/cpuinfo) @@ -51,4 +40,5 @@ cp -Rv /home/quentinbd/upgrade-mff/olds/worlds/ /home/quentinbd/mff/ cp /home/quentinbd/upgrade-mff/olds/minetest.conf /home/quentinbd/mff/ # Donne les droits à quentinbd +chmod -R 755 /home/quentinbd/mff/ chown -R quentinbd:quentinbd /home/quentinbd/