Mods et fichiers worlds peuvent être mis à jour par script
- upgrade.sh entièrement réécrit - shutdown.sh peut faire une mise à jour des mods et des fichiers worlds à le fermeture du serveur en appelant le script upgrade.sh - install.sh fait appel au script upgrade.sh pour remplir le dossier world lors de sa création. - Réorganisation des fichier world - Mise à jour des news - Désactivation des frames de technic
This commit is contained in:
24
shutdown.sh
Normal file → Executable file
24
shutdown.sh
Normal file → Executable file
@@ -1,8 +1,22 @@
|
||||
#!/bin/bash
|
||||
serverpath=/home/minetest/nalc-1.1
|
||||
serverpath=/home/minetest/nalc-stable
|
||||
world=nalc-stable
|
||||
world_file=all # news|technic|fbn|fbnp|bitchange|christmas|randommsg
|
||||
branch=stable # 1.0|1.1|dev
|
||||
bak=0
|
||||
update=0
|
||||
restart=0
|
||||
|
||||
usage() {
|
||||
echo "usage: ./shutdown.sh [-h|--help] [-r|--restart] [-b|--bak] [-u|--update]"
|
||||
echo "Options:"
|
||||
echo -e "\t-h --help\tAffiche cette aide."
|
||||
echo -e "\t-r --restart\tRedémarre le serveur après arrêt."
|
||||
echo -e "\t-b --bak\tRéalise une sauvegarde après arrêt."
|
||||
echo -e "\t-u --update\tRéalise une mise à jour après arrêt."
|
||||
exit 0
|
||||
}
|
||||
|
||||
action() {
|
||||
kill -s TERM $(pidof minetestserver)
|
||||
sleep 10
|
||||
@@ -10,6 +24,7 @@ action() {
|
||||
kill -s TERM $(pidof -x $serverpath/start.sh)
|
||||
|
||||
[[ $bak -eq 1 ]] && $serverpath/backup.sh
|
||||
[[ $update -eq 1 ]] && $serverpath/upgrade.sh -s $serverpath -m -w $world -b $branch -f $world_file
|
||||
[[ $restart -eq 1 ]] && $serverpath/start.sh&
|
||||
|
||||
exit 0
|
||||
@@ -22,7 +37,7 @@ action() {
|
||||
|
||||
# -o : Options courtes
|
||||
# -l : options longues
|
||||
OPT=$(getopt -o b,r -l bak,restart -- "$@")
|
||||
OPT=$(getopt -o b,r,h,u -l bak,restart,help,update -- "$@")
|
||||
|
||||
# éclatement de $options en $1, $2...
|
||||
set -- $OPT
|
||||
@@ -35,6 +50,11 @@ while true; do
|
||||
-r|--restart)
|
||||
restart=1
|
||||
shift;;
|
||||
-h|--help)
|
||||
usage;;
|
||||
-u|--update)
|
||||
update=1
|
||||
shift;;
|
||||
--)
|
||||
shift;;
|
||||
*)
|
||||
|
||||
Reference in New Issue
Block a user