1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/borgwarehouse_ynh.git synced 2024-09-03 18:16:17 +02:00
borgwarehouse_ynh/scripts/change_url

52 lines
1.7 KiB
Text
Raw Permalink Normal View History

2023-10-17 12:13:49 +02: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..." --weight=1
2023-10-17 12:18:31 +02:00
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
2023-10-17 12:13:49 +02:00
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
ynh_change_url_nginx_config
#=================================================
2023-10-17 12:18:31 +02:00
# ADD A CONFIGURATION
2023-10-17 12:13:49 +02:00
#=================================================
2023-10-17 12:18:31 +02:00
ynh_script_progression --message="Adding a configuration file..." --weight=1
2024-06-17 19:01:39 +02:00
ynh_add_config --template=".env" --destination="$data_dir/app/.env.local"
2023-10-17 12:18:31 +02:00
2024-06-17 19:01:39 +02:00
chmod 400 "$data_dir/app/.env.local"
chown $app:$app "$data_dir/app/.env.local"
2023-10-17 12:13:49 +02:00
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
2023-10-17 12:18:31 +02:00
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
2023-10-17 12:13:49 +02:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last