Compare commits

...

2 commits

Author SHA1 Message Date
Hippolyte Chauvin
1d3d68926b qemush : fallback sur la variable EDITOR 2023-11-29 14:52:06 +01:00
Hippolyte Chauvin
651f52d7a1 qemush : finalement la fonction exec_as était utile oups 2023-11-29 14:48:24 +01:00

View file

@ -1,15 +1,24 @@
#!/bin/bash
if [ "$(whoami)" != root ]; then
exec sudo -u qemu "$0" "$@"
else
cd || exit
fi
exec_as() {
local user
user="$1"
shift
if [ "$(whoami)" != "$user" ]; then
exec sudo -u "$user" "$0" "$@"
else
cd || exit
fi
}
exec_as qemu "$@"
bin=bin
images=images
PATH="./${bin}:${PATH}"
EDITOR="${EDITOR:-nvim}"
alias ls='ls --color=auto'
shopt -s expand_aliases