gist-ynh/scripts/upgrade

38 lines
742 B
Plaintext
Raw Normal View History

2016-09-27 22:35:52 +02:00
#!/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
2016-09-27 22:49:43 +02:00
export PATH="$PATH:."
cd $src_path
sudo make update
2016-09-27 22:35:52 +02:00
sudo chown -R root: $src_path
sudo chown -R www-data: $src_path/data/git/
2016-09-27 22:49:43 +02:00
cd -
2016-09-27 22:35:52 +02:00
# Reload nginx service
sudo service nginx reload