1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tiddlywiki_ynh.git synced 2024-09-03 20:26:34 +02:00
This commit is contained in:
ericgaspar 2021-02-16 16:17:53 +01:00
parent 3efea5700e
commit ced8e5baad
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 15 additions and 2 deletions

View file

@ -17,3 +17,16 @@ nodejs_version=14
#================================================= #=================================================
# FUTURE OFFICIAL HELPERS # FUTURE OFFICIAL HELPERS
#================================================= #=================================================
# 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
}

View file

@ -87,7 +87,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Configuring system user ..." --weight=1 ynh_script_progression --message="Configuring system user..." --weight=1
# Create a system user # Create a system user
ynh_system_user_create --username=$app --home_dir=$final_path ynh_system_user_create --username=$app --home_dir=$final_path
@ -99,7 +99,7 @@ ynh_script_progression --message="tiddlywiki..." --weight=2
pushd $final_path pushd $final_path
#$nodejs_path/node $final_path/tiddlywiki mywiki --init server #$nodejs_path/node $final_path/tiddlywiki mywiki --init server
ynh_exec_as $app env "$ynh_node_load_PATH" $final_path/ mywiki --init server ynh_exec_as $app env "$ynh_node_load_PATH" $final_path/tiddlywiki mywiki --init server
popd popd
#================================================= #=================================================