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
else user="$1"
cd || exit shift
fi
if [ "$(whoami)" != "$user" ]; then
exec sudo -u "$user" "$0" "$@"
else
cd || exit
fi
}
exec_as qemu "$@"
bin=bin bin=bin
images=images images=images