1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/invidious_ynh.git synced 2024-09-03 19:15:55 +02:00
invidious_ynh/scripts/_common.sh

33 lines
913 B
Bash
Raw Normal View History

2020-11-09 22:28:22 +01:00
#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
# dependencies used by the app
2021-03-04 08:55:39 +01:00
pkg_dependencies="crystal apt-transport-https libssl-dev libxml2-dev libyaml-dev libgmp-dev libreadline-dev postgresql librsvg2-bin libsqlite3-dev zlib1g-dev"
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
}