qemush : finalement la fonction exec_as était utile oups

This commit is contained in:
Hippolyte Chauvin 2023-11-29 14:48:24 +01:00
parent 21643ed7f8
commit 651f52d7a1

View file

@ -1,10 +1,18 @@
#!/bin/bash #!/bin/bash
if [ "$(whoami)" != root ]; then exec_as() {
exec sudo -u qemu "$0" "$@" local user
user="$1"
shift
if [ "$(whoami)" != "$user" ]; then
exec sudo -u "$user" "$0" "$@"
else else
cd || exit cd || exit
fi fi
}
exec_as qemu "$@"
bin=bin bin=bin
images=images images=images