1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lutim_ynh.git synced 2024-09-03 19:36:24 +02:00
lutim_ynh/scripts/change_url
Éric Gaspar be49a8a1b9
Testing (#74)
* Auto-update README

* Version 2 (#73)

* v2

* Auto-update README

* v2

* Auto-update README

* Update manifest.toml

* Update _common.sh

* Update manifest.toml

* Update tests.toml

* fix

* fix

* Update upgrade

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>

* fix

* Update upgrade

* Update upgrade

* Update manifest.toml

* Auto-update README

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
2023-05-20 20:29:05 +02:00

67 lines
2.2 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# ACTIVATE MAINTENANCE MODE
#=================================================
path=$old_path
domain=$old_domain
ynh_maintenance_mode_ON
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# REPLACE THE PATH IN THE CONFIG OF LUTIM
#=================================================
ynh_replace_string --match_string="\(^ *prefix.*=> '\).*" --replace_string="\1$new_path'," --target_file="$install_dir/lutim.conf"
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=3
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --line_match="Manager.*started" --log_path="/var/log/$app/production.log" --timeout="120"
#=================================================
# DEACTIVE MAINTENANCE MODE
#=================================================
path=$old_path
domain=$old_domain
ynh_maintenance_mode_OFF
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last