mirror of
https://github.com/YunoHost-Apps/phpsysinfo_ynh.git
synced 2024-09-03 19:56:43 +02:00
Add upgrade
This commit is contained in:
parent
347164c026
commit
8042f4431a
1 changed files with 39 additions and 1 deletions
|
@ -3,5 +3,43 @@
|
|||
# Exit on command errors and treat unset variables as an error
|
||||
set -eu
|
||||
|
||||
# See comments in install script
|
||||
app=phpsysinfo
|
||||
|
||||
# Source YunoHost helpers
|
||||
. /usr/share/yunohost/helpers
|
||||
. /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)
|
||||
|
||||
# Remove trailing "/" for next commands
|
||||
path=${path%/}
|
||||
|
||||
# Copy source files
|
||||
final_path=/var/www/$app
|
||||
sudo mkdir -p $final_path
|
||||
sudo cp -a ../sources/. $final_path
|
||||
|
||||
# Set permissions to app files
|
||||
# you may need to make some file and/or directory writeable by www-data (nginx user)
|
||||
sudo chown -R root:root $final_path
|
||||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf
|
||||
sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
# If app is public, add url to SSOWat conf as skipped_uris
|
||||
if [[ $is_public -eq 1 ]];
|
||||
then
|
||||
# See install script
|
||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||
# Remove old settings
|
||||
ynh_app_setting_delete "$app" skipped_uris
|
||||
fi
|
||||
|
||||
# Restart services
|
||||
sudo service nginx reload
|
Loading…
Add table
Reference in a new issue