1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grav_ynh.git synced 2024-09-03 19:16:01 +02:00

[enh] Update plugins after upgrade

This commit is contained in:
tituspijean 2018-10-07 11:27:33 +02:00
parent 339947f369
commit d00b268e2c
2 changed files with 24 additions and 0 deletions

View file

@ -1 +1,15 @@
#!/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 -u "$USER" $@
fi
}

View file

@ -103,6 +103,16 @@ ynh_system_user_create "$app"
# Create a dedicated php-fpm config
ynh_add_fpm_config
#=================================================
# SPECIFIC UPGRADE
#=================================================
# UPDATE PLUGINS
#=================================================
pushd "$final_path"
exec_as "$app" "bin/gpm update -y"
popd
#=================================================
# GENERIC FINALIZATION
#=================================================