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