From bbf59bab0b0a98cedd11a423e59b92fe60ee513e Mon Sep 17 00:00:00 2001 From: Ahurac Date: Tue, 12 Mar 2024 11:20:11 +0100 Subject: [PATCH] qemush : suppression fonction inutile --- bin/qemush | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/bin/qemush b/bin/qemush index 724d4e7..ae826bb 100755 --- a/bin/qemush +++ b/bin/qemush @@ -1,19 +1,8 @@ #!/usr/bin/env bash -# version=0.6.0 +# version=0.6.1 -# Function to re-exec the script as another user via sudo (only if needed) -exec_as() { - local user - user="$1" - shift - - if [ "$(whoami)" != "$user" ]; then - exec sudo -E -H -u "$user" -- "$0" "$@" - fi -} - -# Exec the script as qemu -exec_as qemu "$@" +# Re-exec the script as qemu via sudo (only if needed) +[ "$(whoami)" != qemu ] && exec sudo -E -H -u qemu -- "$0" "$@" # Environment PATH="${HOME}/launchers:${HOME}/bin:${PATH}"