From 6bb52aef8cd0a70d3e848b98248e5f3f25e0b0df Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Tue, 23 Aug 2022 17:48:18 +0200 Subject: [PATCH] ynh_exec_as() exists --- scripts/_common.sh | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index faab65e..24083aa 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -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 -}