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

63 lines
2.6 KiB
Text
Raw Permalink Normal View History

2022-03-29 11:08:51 +02:00
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
2022-12-30 12:24:18 +01:00
ynh_script_progression --message="Stopping a systemd service..." --weight=1
2022-03-29 11:08:51 +02:00
2022-12-30 12:24:18 +01:00
ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log"
2022-12-30 19:30:56 +01:00
ynh_systemd_action --service_name="$app-consumer" --action="stop" --log_path="/var/log/$app/$app-consumer.log"
ynh_systemd_action --service_name="$app-scheduler" --action="stop" --log_path="/var/log/$app/$app-scheduler.log"
ynh_systemd_action --service_name="$app-task-queue" --action="stop" --log_path="/var/log/$app/$app-task-queue.log"
2022-03-29 11:08:51 +02:00
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
2022-12-30 12:24:18 +01:00
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
2022-03-29 11:08:51 +02:00
ynh_change_url_nginx_config
2022-03-29 11:08:51 +02:00
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
2022-12-30 12:24:18 +01:00
# MODIFY A CONFIGURATION
2022-03-29 11:08:51 +02:00
#=================================================
2022-12-30 12:24:18 +01:00
ynh_script_progression --message="Modifying a configuration file..." --weight=1
domain="$new_domain"
path="$new_path"
2022-12-30 12:24:18 +01:00
ynh_add_config --template="paperless.conf.example" --destination="$install_dir/paperless.conf"
2022-12-30 12:24:18 +01:00
chmod 400 "$install_dir/paperless.conf"
chown $app:$app "$install_dir/paperless.conf"
2022-03-29 11:08:51 +02:00
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
2022-12-30 12:24:18 +01:00
ynh_script_progression --message="Starting a systemd service..." --weight=1
2022-03-29 11:08:51 +02:00
2022-12-30 12:24:18 +01:00
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
2022-12-30 19:30:56 +01:00
ynh_systemd_action --service_name="$app-consumer" --action="start" --log_path="/var/log/$app/$app-consumer.log"
ynh_systemd_action --service_name="$app-scheduler" --action="start" --log_path="/var/log/$app/$app-scheduler.log"
ynh_systemd_action --service_name="$app-task-queue" --action="start" --log_path="/var/log/$app/$app-task-queue.log"
2022-03-29 11:08:51 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2022-12-30 12:24:18 +01:00
ynh_script_progression --message="Change of URL completed for $app" --last