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
Éric Gaspar 3dee82137a Upgrade to v.1.2.1 (#10)
* Update README.md

Fix integration badge link

* v.1.2.0

* v.1.2.1

* Update app.src
2020-10-23 10:56:20 +02:00

31 lines
733 B
Bash

#!/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
}