ynh_exec_as() exists

This commit is contained in:
JensDiemer 2022-08-23 17:48:18 +02:00
parent efa160ac1b
commit 6bb52aef8c

View file

@ -85,17 +85,3 @@ ynh_redis_remove_db() {
redis-cli -n "$db" flushall
}
#=================================================
# Execute a command as another user
# usage: ynh_exec_as USER COMMAND [ARG ...]
ynh_exec_as() {
local USER=$1
shift 1
if [[ $USER = $(whoami) ]]; then
eval "$@"
else
sudo -u "$USER" "$@"
fi
}