2021-09-18 14:27:12 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
|
2021-09-18 23:14:02 +02:00
|
|
|
timezone="$(cat /etc/timezone)"
|
2021-09-18 14:27:12 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=2
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action=stop --log_path=systemd
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
|
|
|
|
|
2023-03-31 20:51:42 +02:00
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
2021-09-18 23:14:02 +02:00
|
|
|
#=================================================
|
|
|
|
# ADD A CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
2023-03-31 20:58:08 +02:00
|
|
|
|
2021-09-18 23:14:02 +02:00
|
|
|
domain=$new_domain
|
|
|
|
path=$new_path
|
2023-03-31 20:51:42 +02:00
|
|
|
ynh_add_config --template="../conf/.env" --destination="$install_dir/.env"
|
2021-09-18 23:14:02 +02:00
|
|
|
|
2023-03-31 20:51:42 +02:00
|
|
|
chmod 400 "$install_dir/.env"
|
|
|
|
chown $app:$app "$install_dir/.env"
|
2021-09-18 23:14:02 +02:00
|
|
|
|
2021-09-18 14:27:12 +02:00
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=6
|
|
|
|
|
|
|
|
# Start a systemd service
|
2021-09-18 23:14:02 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Editor is now accessible via:"
|
2021-09-18 14:27:12 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-09-18 15:01:21 +02:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|