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
Tagada 87c2c44b3f
Convert to packaging v2 (#23)
* convert to v2

* v2

* Use /opt/yunohost/__APP__

* v2

* v2

* Auto-update README

* fix

* v2

* v2

* v2

* v2

* Auto-update README

* v2

* typo

* set redis_db in restore script

* fix api permissions

* linter please

* Fix api access

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: Fabian Wilkens <46000361+FabianWilkens@users.noreply.github.com>
2023-05-28 20:21:14 +02:00

62 lines
2.6 KiB
Bash

#!/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
ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log"
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"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# MODIFY A CONFIGURATION
#=================================================
ynh_script_progression --message="Modifying a configuration file..." --weight=1
domain="$new_domain"
path="$new_path"
ynh_add_config --template="paperless.conf.example" --destination="$install_dir/paperless.conf"
chmod 400 "$install_dir/paperless.conf"
chown $app:$app "$install_dir/paperless.conf"
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
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"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last