mirror of
https://github.com/YunoHost-Apps/leed_ynh.git
synced 2024-09-03 19:26:32 +02:00
Update upgrade
This commit is contained in:
parent
4e5d6ec1fb
commit
c32b6d6812
1 changed files with 38 additions and 0 deletions
|
@ -1 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Retrieve arguments
|
||||
domain=$(sudo yunohost app setting leed domain)
|
||||
path=$(sudo yunohost app setting leed path)
|
||||
language=$(sudo yunohost app setting leed language)
|
||||
is_public=$(sudo yunohost app setting leed is_public)
|
||||
|
||||
# Copy files to right place
|
||||
final_path=/var/www/leed
|
||||
sudo mkdir -p $final_path
|
||||
sudo cp -a ../sources/* $final_path
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/leed.conf
|
||||
|
||||
# Set right permissions
|
||||
sudo chown -R www-data: $final_path
|
||||
|
||||
# Change variables in Leed configuration
|
||||
sudo sed -i "s@PATHTOCHANGE@$path@g" /etc/nginx/conf.d/$domain.d/leed.conf
|
||||
sudo sed -i "s@ALIASTOCHANGE@$final_path/@g" /etc/nginx/conf.d/$domain.d/leed.conf
|
||||
|
||||
# Réglage de la langue choisie
|
||||
sed -i "s@define('LANGUAGE','.*');@define('LANGUAGE','$language');@" $final_path/constant.php
|
||||
|
||||
# Make app private if necessary
|
||||
sudo yunohost app setting leed is_public -v "$is_public"
|
||||
if [ "$is_public" = "No" ];
|
||||
then
|
||||
# Retire l'autorisation d'accès de la page d'install.
|
||||
sudo yunohost app setting leed skipped_uris -d
|
||||
# Rend la page d'actualisation accessible pour le script cron.
|
||||
sudo yunohost app setting leed skipped_uris -v "/action.php"
|
||||
else # Si l'app est publique
|
||||
sudo yunohost app setting leed skipped_uris -v "/"
|
||||
fi
|
||||
|
||||
# Reload Nginx and regenerate SSOwat conf
|
||||
sudo service nginx reload
|
||||
sudo yunohost app ssowatconf
|
||||
|
|
Loading…
Add table
Reference in a new issue