2020-11-09 22:28:22 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# dependencies used by the app
|
2021-03-30 08:27:04 +02:00
|
|
|
pkg_dependencies="apt-transport-https libssl-dev libxml2-dev libyaml-dev libgmp-dev libreadline-dev postgresql librsvg2-bin libsqlite3-dev zlib1g-dev" #crystal
|
2020-11-09 22:28:22 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|
2020-11-10 11:05:07 +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
|
|
|
|
}
|