Correction : les arguments n'étaient pas correctement passés

This commit is contained in:
Hippolyte Chauvin 2023-07-04 20:35:11 +02:00
parent d7a948723f
commit 6c092c3c07

View file

@ -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