dotfiles/bin/qemush
2023-10-15 11:33:46 +02:00

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" "$@"