gist-ynh/scripts/upgrade
2016-09-27 22:35:52 +02:00

31 lines
693 B
Bash
Executable file

#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu
# See comments in install script
app=$YNH_APP_INSTANCE_NAME
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
path=$(ynh_app_setting_get "$app" path)
admin=$(ynh_app_setting_get "$app" admin)
is_public=$(ynh_app_setting_get "$app" is_public)
language=$(ynh_app_setting_get "$app" language)
# Remove trailing "/" for next commands
path=${path%/}
# Copy source files
src_path=/var/www/$app
make update
sudo chown -R root: $src_path
sudo chown -R www-data: $src_path/data/git/
# Reload nginx service
sudo service nginx reload