From 6c092c3c0720876564ee21498b7896bd9eb8d023 Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Tue, 4 Jul 2023 20:35:11 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20:=20les=20arguments=20n'=C3=A9taie?= =?UTF-8?q?nt=20pas=20correctement=20pass=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/mcserv | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/mcserv b/bin/mcserv index a84e3d9..d008094 100755 --- a/bin/mcserv +++ b/bin/mcserv @@ -1,14 +1,16 @@ #!/bin/bash exec_user() { - if [ "$USER" != "$1" ]; then - exec sudo -u "$1" "$0" "$@" + local user="$1" + shift + if [ "$USER" != "$user" ]; then + exec sudo -u "$user" "$0" "$@" else return 0 fi } -exec_user minecraft +exec_user minecraft "$@" cd ~/bin || exit