forked from ahurac/dotfiles
qemush : finalement la fonction exec_as était utile oups
This commit is contained in:
parent
21643ed7f8
commit
651f52d7a1
1 changed files with 13 additions and 5 deletions
16
bin/qemush
16
bin/qemush
|
@ -1,10 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ "$(whoami)" != root ]; then
|
exec_as() {
|
||||||
exec sudo -u qemu "$0" "$@"
|
local user
|
||||||
else
|
user="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
if [ "$(whoami)" != "$user" ]; then
|
||||||
|
exec sudo -u "$user" "$0" "$@"
|
||||||
|
else
|
||||||
cd || exit
|
cd || exit
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
exec_as qemu "$@"
|
||||||
|
|
||||||
bin=bin
|
bin=bin
|
||||||
images=images
|
images=images
|
||||||
|
|
Loading…
Reference in a new issue