mirror of
https://github.com/YunoHost-Apps/framaforms_ynh.git
synced 2024-09-03 18:36:12 +02:00
125 lines
2.6 KiB
Bash
125 lines
2.6 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC STARTING
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# RETRIEVE ARGUMENTS
|
|
#=================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
|
|
|
|
|
|
|
|
# Add settings here as needed by your application
|
|
|
|
#=================================================
|
|
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
|
#=================================================
|
|
|
|
|
|
# Backup the current version of the app
|
|
|
|
|
|
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
|
|
|
|
|
|
# Restore it if the upgrade fails
|
|
|
|
}
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
|
|
#=================================================
|
|
# CHECK WHICH PARTS SHOULD BE CHANGED
|
|
#=================================================
|
|
|
|
|
|
|
|
then
|
|
|
|
fi
|
|
|
|
|
|
|
|
then
|
|
|
|
fi
|
|
|
|
#=================================================
|
|
# STANDARD MODIFICATIONS
|
|
#=================================================
|
|
# MODIFY URL IN NGINX CONF
|
|
#=================================================
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
|
|
|
# Change the path in the NGINX config file
|
|
if [ $change_path -eq 1 ]
|
|
then
|
|
# Make a backup of the original NGINX config file if modified
|
|
|
|
# Set global variables for NGINX helper
|
|
|
|
|
|
# Create a dedicated NGINX config
|
|
|
|
fi
|
|
|
|
# Change the domain for NGINX
|
|
if [ $change_domain -eq 1 ]
|
|
then
|
|
# Delete file checksum for the old conf file location
|
|
|
|
|
|
# Store file checksum for the new config file location
|
|
|
|
fi
|
|
|
|
#=================================================
|
|
# SPECIFIC MODIFICATIONS
|
|
#=================================================
|
|
# UPDATE DRUSH ALIAS
|
|
#=================================================
|
|
ynh_script_progression --message="Updating Drush alias..." --weight=1
|
|
|
|
domain="$new_domain"
|
|
path="$new_path"
|
|
|
|
ynh_add_config --template="../conf/yoursite.aliases.drushrc.php" --destination="$install_dir/.drush/$app.aliases.drushrc.php"
|
|
|
|
#=================================================
|
|
# GENERIC FINALISATION
|
|
#=================================================
|
|
# RELOAD NGINX
|
|
#=================================================
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|