dotfiles/bin/qemush

21 lines
231 B
Text
Raw Normal View History

#!/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" "$@"