qemush : suppression fonction inutile
This commit is contained in:
parent
78fdd1c4a0
commit
bbf59bab0b
1 changed files with 3 additions and 14 deletions
17
bin/qemush
17
bin/qemush
|
@ -1,19 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/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)
|
# Re-exec the script as qemu via sudo (only if needed)
|
||||||
exec_as() {
|
[ "$(whoami)" != qemu ] && exec sudo -E -H -u qemu -- "$0" "$@"
|
||||||
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 "$@"
|
|
||||||
|
|
||||||
# Environment
|
# Environment
|
||||||
PATH="${HOME}/launchers:${HOME}/bin:${PATH}"
|
PATH="${HOME}/launchers:${HOME}/bin:${PATH}"
|
||||||
|
|
Loading…
Reference in a new issue