1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tiddlywiki_ynh.git synced 2024-09-03 20:26:34 +02:00
tiddlywiki_ynh/scripts/_common.sh

33 lines
742 B
Bash
Raw Normal View History

2021-02-16 14:17:45 +01:00
#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
nodejs_version=14
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
2021-03-27 15:22:24 +01:00
# 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
}