mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 17:50:37 +01:00
add some server side scripts and re-organize the script folder
This commit is contained in:
parent
502a814dd3
commit
caed822407
8
other_things/scripts/Server-side/script/news-mff-rsync.sh
Executable file
8
other_things/scripts/Server-side/script/news-mff-rsync.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
#rsync -e "ssh -i /root/.ssh/id_dsa" -av --delete-after /home/quentinbd/minetest/worlds/minetestforfun/news.txt root@192.168.1.20:/var/www/wordpress/wp-content/uploads/news/
|
||||
# Check the public key rights
|
||||
chmod 600 /home/quentinbd/.ssh/id_rsa
|
||||
chmod 600 /home/quentinbd/.ssh/id_rsa.pub
|
||||
# Begin the RSYNC
|
||||
rsync -azrv --delete /home/quentinbd/minetest/worlds/minetestforfun/news.txt quentinbd@192.168.1.20:/var/www/wordpress/wp-content/uploads/news/
|
||||
echo "Transfert réussi de news.txt sur le wordpress"
|
26
other_things/scripts/Server-side/script/start-mff-hg.sh
Executable file
26
other_things/scripts/Server-side/script/start-mff-hg.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
DEBUG='/home/quentinbd/script/debug-mff-hg.txt'
|
||||
MOREDEBUG='/home/quentinbd/script/moredebug-mff-hg.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-hg/bin/minetestserver \
|
||||
--world /home/quentinbd/mff-hg/worlds/minetestforfun-hg/ \
|
||||
--config /home/quentinbd/mff-hg/minetest.conf \
|
||||
--gameid hungry_games \
|
||||
--port 30042 \
|
||||
# --logfile $DEBUG
|
||||
|
||||
sleep 25
|
||||
done &>> $MOREDEBUG
|
27
other_things/scripts/Server-side/script/start-mff.sh
Executable file
27
other_things/scripts/Server-side/script/start-mff.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
DEBUG='/home/quentinbd/script/debug-mff.txt'
|
||||
MOREDEBUG='/home/quentinbd/script/moredebug-mff.txt'
|
||||
|
||||
cd /home/quentinbd/mff
|
||||
|
||||
while true
|
||||
do
|
||||
sleep 5
|
||||
|
||||
echo "----------------------" >>$MOREDEBUG
|
||||
echo "Server restarted at "`date` >>$MOREDEBUG
|
||||
echo "----------------------" >>$MOREDEBUG
|
||||
|
||||
echo "0" >/tmp/players_c.txt
|
||||
|
||||
/home/quentinbd/mff/bin/minetestserver \
|
||||
--world /home/quentinbd/mff/worlds/minetestforfun/ \
|
||||
--config /home/quentinbd/mff/minetest.conf \
|
||||
--gameid minetestforfun_game \
|
||||
--port 30001 \
|
||||
# --logfile $DEBUG
|
||||
|
||||
sleep 25
|
||||
done &>> $MOREDEBUG
|
||||
|
55
other_things/scripts/Server-side/upgrade-mff-hg/upgrade-part-mff-hg.sh
Executable file
55
other_things/scripts/Server-side/upgrade-mff-hg/upgrade-part-mff-hg.sh
Executable file
@ -0,0 +1,55 @@
|
||||
# on récupère la dernière version du jeu
|
||||
cd /home/quentinbd/
|
||||
git clone https://github.com/MinetestForFun/hungry_games.git
|
||||
echo "Clone de minetest-minetestforfun-server réussit."
|
||||
cd /home/quentinbd/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."
|
||||
|
||||
cp -R /home/quentinbd/mff-hg/games /home/quentinbd/upgrade-mff-hg/olds-part/subgame/
|
||||
echo "Sauvegarde du subgame correctement effectuée."
|
||||
|
||||
# on MAJ le novueau subgame
|
||||
rm -Rf /home/quentinbd/mff-hg/games/
|
||||
mkdir /home/quentinbd/mff-hg/games/
|
||||
cp -R /home/quentinbd/hungry_games/ /home/quentinbd/mff-hg/games/
|
||||
echo "Nouveau subgame correctement déplacé."
|
||||
|
||||
# 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
|
||||
mkdir /home/quentinbd/mff-hg/worlds/minetestforfun-hg/
|
||||
mv /home/quentinbd/mff-hg/worlds/* /home/quentinbd/mff-hg/worlds/minetestforfun-hg/
|
||||
rm /home/quentinbd/mff-hg/worlds/minetestforfun-hg/world.mt
|
||||
rm /home/quentinbd/mff-hg/minetest.conf
|
||||
#cp /home/quentinbd/hungry_games/worlds/minetestforfun/news.txt /home/quentinbd/mff/worlds/minetestforfun/
|
||||
cp /home/quentinbd/hungry_games/worlds/minetestforfun-hg/random_messages /home/quentinbd/mff-hg/worlds/minetestforfun-hg/
|
||||
cp /home/quentinbd/hungry_games/worlds/minetestforfun-hg/world.mt /home/quentinbd/mff-hg/worlds/minetestforfun-hg/
|
||||
cp /home/quentinbd/hungry_games/minetest.conf /home/quentinbd/mff-hg/minetest.conf
|
||||
echo "Nouveau world.mt correctement déplacé"
|
||||
|
||||
# Suppression du dossier cloné
|
||||
rm -Rf /home/quentinbd/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/
|
||||
echo "ré-attribution des droits à quentinbd:quentinbd"
|
51
other_things/scripts/Server-side/upgrade-mff-hg/w-upgrade-mff-hg.sh
Executable file
51
other_things/scripts/Server-side/upgrade-mff-hg/w-upgrade-mff-hg.sh
Executable file
@ -0,0 +1,51 @@
|
||||
# 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
|
||||
|
||||
# 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/worlds/ /home/quentinbd/upgrade-mff/olds/
|
||||
#cp /home/quentinbd/mff-hg/minetest.conf /home/quentinbd/upgrade-mff/olds/
|
||||
|
||||
# Sauvegarde et compression du dossier minetest (au cas ou)
|
||||
#cd /home/quentinbd/upgrade-mff/
|
||||
#tar -cf mff.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
|
||||
wget https://github.com/minetest/minetest/archive/stable-0.4.zip
|
||||
unzip /home/quentinbd/stable-0.4.zip
|
||||
mv /home/quentinbd/minetest-stable-0.4/ /home/quentinbd/mff-hg/
|
||||
# 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
|
||||
cmake . -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=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/
|
||||
|
||||
# Donne les droits à quentinbd
|
||||
chmod -R 755 /home/quentinbd/mff-hg/
|
||||
chown -R quentinbd:quentinbd /home/quentinbd/mff-hg/
|
53
other_things/scripts/Server-side/upgrade-mff/upgrade-part-mff.sh
Executable file
53
other_things/scripts/Server-side/upgrade-mff/upgrade-part-mff.sh
Executable file
@ -0,0 +1,53 @@
|
||||
# on récupère la dernière version du jeu
|
||||
cd /home/quentinbd/
|
||||
git clone https://github.com/MinetestForFun/minetest-minetestforfun-server.git
|
||||
echo "Clone de minetest-minetestforfun-server réussit."
|
||||
cd /home/quentinbd/minetest-minetestforfun-server/
|
||||
git submodule update --init --recursive
|
||||
|
||||
# on sauvegarde les anciens minetest/games et minetest/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."
|
||||
|
||||
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
|
||||
rm -R /home/quentinbd/mff/games/
|
||||
rm -R /home/quentinbd/mff/mods/
|
||||
mkdir /home/quentinbd/mff/games/
|
||||
cp -R /home/quentinbd/minetest-minetestforfun-server/minetestforfun_game/ /home/quentinbd/mff/games/
|
||||
cp -R /home/quentinbd/minetest-minetestforfun-server/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
|
||||
rm /home/quentinbd/mff/worlds/minetestforfun/world.mt
|
||||
cp /home/quentinbd/minetest-minetestforfun-server/worlds/minetestforfun/news.txt /home/quentinbd/mff/worlds/minetestforfun/
|
||||
cp /home/quentinbd/minetest-minetestforfun-server/worlds/minetestforfun/random_messages /home/quentinbd/mff/worlds/minetestforfun/
|
||||
cp /home/quentinbd/minetest-minetestforfun-server/worlds/minetestforfun/world.mt /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/minetest-minetestforfun-server/
|
||||
echo "Bravo ! minetest/mods et minetest/games maintenant à jour"
|
||||
|
||||
# TEMPORAIRE - ré-ajout de l'ancien mod irc
|
||||
rm -R /home/quentinbd/mff/mods/irc/
|
||||
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/
|
||||
chown -R 755 /home/quentinbd/
|
||||
echo "ré-attribution des droits à quentinbd:quentinbd"
|
53
other_things/scripts/Server-side/upgrade-mff/w-upgrade-mff.sh
Executable file
53
other_things/scripts/Server-side/upgrade-mff/w-upgrade-mff.sh
Executable file
@ -0,0 +1,53 @@
|
||||
# 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
|
||||
rm -Rv /home/quentinbd/upgrade-mff/mff.tar.gz
|
||||
|
||||
# Sauvegarde des fichiers critiques
|
||||
cp -Rv /home/quentinbd/mff/games/minetestforfun_game/ /home/quentinbd/upgrade-mff/olds/
|
||||
cp -Rv /home/quentinbd/mff/mods/ /home/quentinbd/upgrade-mff/olds/
|
||||
cp -Rv /home/quentinbd/mff/worlds/ /home/quentinbd/upgrade-mff/olds/
|
||||
cp /home/quentinbd/mff/minetest.conf /home/quentinbd/upgrade-mff/olds/
|
||||
|
||||
# Sauvegarde et compression du dossier minetest (au cas ou)
|
||||
cd /home/quentinbd/upgrade-mff/
|
||||
tar -cf mff.tar.gz /home/quentinbd/mff/
|
||||
|
||||
# Suppression de minetest
|
||||
rm -Rv /home/quentinbd/mff/
|
||||
|
||||
# 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/archive/stable-0.4.zip
|
||||
unzip /home/quentinbd/minetest-stable-0.4.zip
|
||||
mv /home/quentinbd/minetest-stable-0.4/ /home/quentinbd/mff/
|
||||
# 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
|
||||
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/games/
|
||||
cp -Rv /home/quentinbd/upgrade-mff/olds/mods/ /home/quentinbd/mff/
|
||||
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
|
||||
chown -R quentinbd:quentinbd /home/quentinbd/
|
Loading…
Reference in New Issue
Block a user