Correction : ré-écriture compacte de launch-minecraft-server
This commit is contained in:
parent
df173558a9
commit
6faa12608a
1 changed files with 4 additions and 18 deletions
|
@ -1,19 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Fonction pour afficher une erreur
|
||||
error() {
|
||||
printf '\033[1;31m%s\033[0m \033[1m%s\033[0m\n' ERROR: "$1"
|
||||
shift
|
||||
exit "$1"
|
||||
}
|
||||
|
||||
# Se déplacer dans le dossier des serveurs
|
||||
cd /srv/minecraft/servers || exit
|
||||
|
||||
# Se déplacer dans le dossier demandé
|
||||
test -d "${1}" || error "Le serveur \"${1}\" n'existe pas." "$?"
|
||||
cd "${1}"
|
||||
|
||||
# Exécution
|
||||
sudo -u minecraft screen ./start.sh
|
||||
#!/bin/sh -ex
|
||||
cd /srv/minecraft/bin
|
||||
PATH=".:${PATH}"
|
||||
sudo -u minecraft screen "$1"
|
||||
|
||||
|
|
Loading…
Reference in a new issue