1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/headphones_ynh.git synced 2024-09-03 19:26:02 +02:00
headphones_ynh/scripts/change_url

57 lines
2 KiB
Text
Raw Normal View History

2022-03-24 00:32:11 +01:00
#!/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 a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" --line_match="Headphones is shutting down"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..."
2023-05-25 13:10:35 +02:00
ynh_change_url_nginx_config
2022-03-24 00:32:11 +01:00
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a configuration file..."
2023-05-25 13:19:16 +02:00
2023-05-25 13:10:35 +02:00
path=$new_path
2022-03-24 00:32:11 +01:00
domain=$new_domain
2023-05-25 19:09:24 +02:00
ynh_add_config --template="../conf/headphones.ini" --destination="/etc/$app/headphones.ini"
2022-03-24 00:32:11 +01:00
2023-05-25 19:09:24 +02:00
chmod 600 "/etc/$app/headphones.ini"
chown $app:$app "/etc/$app/headphones.ini"
2022-03-24 00:32:11 +01:00
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Starting Headphones web server"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app"