1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ztncui_ynh.git synced 2024-09-03 18:06:05 +02:00
ztncui_ynh/scripts/_common.sh
2020-04-18 18:48:34 +02:00

37 lines
813 B
Bash

#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
nodejs_version=12
# dependencies used by the app
pkg_dependencies="g++"
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#!/bin/bash
# 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 PATH=$PATH -u "$USER" "$@"
fi
}
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================