mirror of
https://github.com/YunoHost-Apps/django_example_ynh.git
synced 2024-09-03 18:26:21 +02:00
ynh_exec_as() exists
This commit is contained in:
parent
efa160ac1b
commit
6bb52aef8c
1 changed files with 0 additions and 14 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue