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
ericgaspar e454d22b6d
Fix
2021-03-27 15:22:24 +01:00

32 lines
742 B
Bash
Executable file

#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
nodejs_version=14
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
# 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
}