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

51 lines
1.4 KiB
Text
Raw Normal View History

2015-11-11 18:03:16 +01:00
#!/bin/bash
2017-03-15 00:18:41 +01:00
# Exit on command errors and treat unset variables as an error
set -eu
2017-03-08 00:50:23 +01:00
source .fonctions # Loads the generic functions usually used in the script
source /usr/share/yunohost/helpers # Source YunoHost helpers
2017-03-02 15:44:54 +01:00
# See comments in install script
app=$YNH_APP_INSTANCE_NAME
# 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)
2017-03-08 00:50:23 +01:00
CHECK_PATH # Checks and corrects the syntax of the path.
2015-11-11 18:03:16 +01:00
2017-03-02 15:44:54 +01:00
final_path=/var/www/$app
# Get source
SETUP_SOURCE
2015-11-11 18:03:16 +01:00
# Modify Nginx configuration file and copy it to Nginx conf directory
2017-03-15 16:24:41 +01:00
sudo sed -i "s@__PATHTOCHANGE__@$path@g" /etc/nginx/conf.d/$domain.d/$app.conf
sudo sed -i "s@__FINALPATH__@$final_path@g" /etc/nginx/conf.d/$domain.d/$app.conf
sudo sed -i "s@__NAMETOCHANGE__@$app@g" /etc/nginx/conf.d/$domain.d/$app.conf
2015-11-11 18:03:16 +01:00
2017-03-15 16:24:41 +01:00
if [ "$is_public" = "Yes" ];
then
sudo sed -i "s@#--PRIVATE--@@g" /etc/nginx/conf.d/$domain.d/$app.conf
fi
# Create the php-fpm pool config
POOL_FPM
2017-04-01 17:08:00 +02:00
sudo chown -R www-data: "${final_path}"
2017-03-15 16:24:41 +01:00
# Setup SSOwat
ynh_app_setting_set "$app" is_public "$is_public"
if [ "$is_public" = "Yes" ];
then
ynh_app_setting_set "$app" unprotected_uris "/"
2015-11-11 18:03:16 +01:00
fi
# Reload Nginx
2017-03-26 16:29:13 +02:00
sudo systemctl reload php5-fpm
sudo systemctl reload nginx
sudo yunohost app ssowatconf