forked from ahurac/dotfiles
20 lines
231 B
Bash
Executable file
20 lines
231 B
Bash
Executable file
#!/bin/bash
|
|
|
|
exec_as() {
|
|
local user="$1"
|
|
shift
|
|
|
|
if [ "$(whoami)" != "$user" ]; then
|
|
exec sudo -u "$user" "$0" "$@"
|
|
else
|
|
cd
|
|
fi
|
|
}
|
|
|
|
exec_as qemu "$@" || exit
|
|
PATH="./bin:${PATH}"
|
|
|
|
vm_name="$1"
|
|
shift
|
|
|
|
"$vm_name" "$@"
|