mirror of
https://github.com/YunoHost-Apps/pgadmin_ynh.git
synced 2024-09-03 19:56:38 +02:00
45 lines
No EOL
1.2 KiB
Bash
45 lines
No EOL
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
|
|
# Source YunoHost helpers
|
|
source /usr/share/yunohost/helpers
|
|
|
|
# Stop script if errors
|
|
ynh_abort_if_errors
|
|
|
|
# Import common cmd
|
|
source ./experimental_helper.sh
|
|
source ./_common.sh
|
|
|
|
# Retrive arguments
|
|
old_domain=$YNH_APP_OLD_DOMAIN
|
|
domain=$YNH_APP_NEW_DOMAIN
|
|
path_url=$(ynh_normalize_url_path ${YNH_APP_NEW_PATH:-'/'})
|
|
http_port=$(ynh_app_setting_get "$app" http_port)
|
|
|
|
#=================================================
|
|
# STANDARD MODIFICATIONS
|
|
#=================================================
|
|
|
|
# Update nginx config
|
|
if [ "$old_domain" != "$domain" ]
|
|
then
|
|
# Delete file checksum for the old conf file location
|
|
ynh_delete_file_checksum "/etc/nginx/conf.d/$old_domain.d/$app.conf"
|
|
|
|
mv "/etc/nginx/conf.d/$old_domain.d/$app.conf" "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
|
|
# Store file checksum for the new config file location
|
|
ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
fi
|
|
ynh_add_nginx_config
|
|
|
|
# Update UWSGI Config
|
|
config_uwsgi
|
|
|
|
# Reload services
|
|
sudo systemctl reload nginx.service
|
|
sudo systemctl restart uwsgi.service |