1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nodered_ynh.git synced 2024-09-03 19:46:25 +02:00
nodered_ynh/scripts/_common.sh
tituspijean 44d4f4a3ea Properly use the permissions system
add permission to dashboard to /ui
and fix scripts filemodes
2021-04-29 21:37:02 +02:00

32 lines
734 B
Bash
Executable file

#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
nodejs_version=12
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
# Execute a command as another user
# usage: exec_as USER COMMAND [ARG ...]
exec_as() {
local USER=$1
shift 1
if [[ $USER = $(whoami) ]]; then
eval "$@"
else
sudo -u "$USER" "$@"
fi
}