mirror of
https://github.com/YunoHost-Apps/dont-code_ynh.git
synced 2024-09-03 18:26:34 +02:00
63 lines
2.4 KiB
Bash
63 lines
2.4 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC STARTING
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# STANDARD MODIFICATIONS
|
|
#=================================================
|
|
# STOP SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Stopping systemd services..." --weight=1
|
|
|
|
for service_name in "${SERVICES_LIST[@]}"; do
|
|
ynh_systemd_action --service_name="${app}-${service_name}" --action="stop" --log_path="/var/log/$app/$app.log"
|
|
done
|
|
|
|
#=================================================
|
|
# MODIFY URL IN NGINX CONF
|
|
#=================================================
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
#=================================================
|
|
# SPECIFIC MODIFICATIONS
|
|
#=================================================
|
|
# Update document url in .env
|
|
#=================================================
|
|
ynh_script_progression --message="Updating .env configuration..."
|
|
|
|
new_document_url=$(append_uri "https://${new_domain}${new_path}" "docs")
|
|
ynh_app_setting_set --app="$app" --key=document_url --value="$new_document_url"
|
|
|
|
ynh_backup_if_checksum_is_different --file="$install_dir/.env"
|
|
ynh_replace_string --match_string="$document_url" --replace_string="$new_document_url" --target_file="$install_dir/.env"
|
|
ynh_store_file_checksum --file="$install_dir/.env"
|
|
|
|
# Update the repository pages
|
|
ynh_add_config --template="repository-next.json" --destination="$data_dir/repository-next.json"
|
|
ynh_add_config --template="repository-stable.json" --destination="$data_dir/repository-stable.json"
|
|
|
|
#=================================================
|
|
# GENERIC FINALISATION
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Starting systemd services..." --weight=1
|
|
|
|
for service_name in "${SERVICES_LIST[@]}"; do
|
|
ynh_systemd_action --service_name="${app}-${service_name}" --action="start" --log_path="/var/log/$app/$app.log"
|
|
done
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|