From 6faa12608af6bd153301289d2d45c5cd8c6cfa10 Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Sun, 2 Jul 2023 15:19:41 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20:=20r=C3=A9-=C3=A9criture=20compac?= =?UTF-8?q?te=20de=20launch-minecraft-server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/launch-minecraft-server | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/bin/launch-minecraft-server b/bin/launch-minecraft-server index 8a33565..fd61d1a 100755 --- a/bin/launch-minecraft-server +++ b/bin/launch-minecraft-server @@ -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"