2019-08-05 01:29:15 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2020-12-01 22:04:05 +01:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..."
|
2019-08-05 01:29:15 +02:00
|
|
|
|
2021-04-30 13:49:31 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped vaultwarden Server"
|
2019-08-05 01:29:15 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2020-12-01 22:04:05 +01:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..."
|
2019-08-05 01:29:15 +02:00
|
|
|
|
2023-06-22 09:09:24 +02:00
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
2019-08-05 01:29:15 +02:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2020-03-21 14:04:37 +01:00
|
|
|
# MODIFY A CONFIG FILE
|
2019-08-05 01:29:15 +02:00
|
|
|
#=================================================
|
2020-12-01 22:04:05 +01:00
|
|
|
ynh_script_progression --message="Modifying a config file..."
|
2020-03-21 14:04:37 +01:00
|
|
|
|
2023-06-22 09:09:24 +02:00
|
|
|
config="$install_dir/live/.env"
|
2020-03-21 14:04:37 +01:00
|
|
|
|
|
|
|
ynh_backup_if_checksum_is_different --file="$config"
|
|
|
|
|
|
|
|
ynh_replace_string --match_string="DOMAIN=https://$old_domain$old_path" --replace_string="DOMAIN=https://$new_domain$new_path" --target_file="$config"
|
|
|
|
|
|
|
|
# Recalculate and store the checksum of the file for the next upgrade.
|
|
|
|
ynh_store_file_checksum --file="$config"
|
2019-08-05 01:29:15 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2020-12-01 22:04:05 +01:00
|
|
|
ynh_script_progression --message="Starting a systemd service..."
|
2019-08-05 01:29:15 +02:00
|
|
|
|
2020-12-01 22:04:05 +01:00
|
|
|
# Start a systemd service
|
2020-01-21 23:03:55 +01:00
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Rocket has launched from" --length=100
|
2019-08-05 01:29:15 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2020-12-01 22:04:05 +01:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app"
|