diff --git a/scripts/backup b/scripts/backup index 5d28395..e7c53ce 100755 --- a/scripts/backup +++ b/scripts/backup @@ -31,10 +31,10 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP SYSTEMD #================================================= -ynh_backup --src_path="/etc/systemd/system/${app}-beat.service" -ynh_backup --src_path="/etc/systemd/system/${app}-server.service" -ynh_backup --src_path="/etc/systemd/system/${app}-worker.service" -ynh_backup --src_path="/etc/systemd/system/$app.target" +ynh_backup --src_path="/etc/systemd/system/bookwyrm-beat.service" +ynh_backup --src_path="/etc/systemd/system/bookwyrm-server.service" +ynh_backup --src_path="/etc/systemd/system/bookwyrm-worker.service" +ynh_backup --src_path="/etc/systemd/system/bookwyrm.target" #================================================= # BACKUP THE POSTGRESQL DATABASE diff --git a/scripts/install b/scripts/install index 873e4e8..b068190 100755 --- a/scripts/install +++ b/scripts/install @@ -63,12 +63,12 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -ynh_add_config --template="../conf/${app}.target" --destination="/etc/systemd/system/$app.target" +ynh_add_config --template="../conf/bookwyrm.target" --destination="/etc/systemd/system/bookwyrm.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="${app}-server" --template="${app}-server.service" -ynh_add_systemd_config --service="${app}-worker" --template="${app}-worker.service" -ynh_add_systemd_config --service="${app}-beat" --template="${app}-beat.service" +ynh_add_systemd_config --service="bookwyrm-server" --template="bookwyrm-server.service" +ynh_add_systemd_config --service="bookwyrm-worker" --template="bookwyrm-worker.service" +ynh_add_systemd_config --service="bookwyrm-beat" --template="bookwyrm-beat.service" #================================================= # GENERIC FINALIZATION @@ -77,9 +77,9 @@ ynh_add_systemd_config --service="${app}-beat" --template="${app}-beat.service #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "${app}-beat" -yunohost service add "${app}-server" -yunohost service add "${app}-worker" +yunohost service add "bookwyrm-beat" +yunohost service add "bookwyrm-server" +yunohost service add "bookwyrm-worker" #================================================= # START SYSTEMD SERVICE @@ -87,9 +87,9 @@ yunohost service add "${app}-worker" ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="systemd" --line_match="Started" -ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" -ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="ready" +ynh_systemd_action --service_name="bookwyrm-beat" --action="start" --log_path="systemd" --line_match="Started" +ynh_systemd_action --service_name="bookwyrm-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" +ynh_systemd_action --service_name="bookwyrm-worker" --action="start" --log_path="systemd" --line_match="ready" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 804edb6..f8e2885 100644 --- a/scripts/remove +++ b/scripts/remove @@ -28,16 +28,16 @@ fi #================================================= ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 -ynh_systemd_action --service_name="${app}-beat" --action="stop" --log_path="systemd" --line_match="Stopped $app" -ynh_systemd_action --service_name="${app}-server" --action="stop" --log_path="systemd" --line_match="Stopped $app" -ynh_systemd_action --service_name="${app}-worker" --action="stop" --log_path="systemd" --line_match="Stopped $app" +ynh_systemd_action --service_name="bookwyrm-beat" --action="stop" --log_path="systemd" --line_match="Stopped $app" +ynh_systemd_action --service_name="bookwyrm-server" --action="stop" --log_path="systemd" --line_match="Stopped $app" +ynh_systemd_action --service_name="bookwyrm-worker" --action="stop" --log_path="systemd" --line_match="Stopped $app" # Remove the dedicated systemd config -ynh_remove_systemd_config --service="${app}-beat" -ynh_remove_systemd_config --service="${app}-server" -ynh_remove_systemd_config --service="${app}-worker" +ynh_remove_systemd_config --service="bookwyrm-beat" +ynh_remove_systemd_config --service="bookwyrm-server" +ynh_remove_systemd_config --service="bookwyrm-worker" -ynh_secure_remove --file="/etc/systemd/system/$app.target" +ynh_secure_remove --file="/etc/systemd/system/bookwyrm.target" #================================================= # REMOVE APP MAIN DIR diff --git a/scripts/restore b/scripts/restore index 2e544a4..a0a0fba 100644 --- a/scripts/restore +++ b/scripts/restore @@ -44,32 +44,32 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 -ynh_restore_file --origin_path="/etc/systemd/system/${app}-beat.service" -ynh_restore_file --origin_path="/etc/systemd/system/${app}-server.service" -ynh_restore_file --origin_path="/etc/systemd/system/${app}-worker.service" -ynh_restore_file --origin_path="/etc/systemd/system/$app.target" +ynh_restore_file --origin_path="/etc/systemd/system/bookwyrm-beat.service" +ynh_restore_file --origin_path="/etc/systemd/system/bookwyrm-server.service" +ynh_restore_file --origin_path="/etc/systemd/system/bookwyrm-worker.service" +ynh_restore_file --origin_path="/etc/systemd/system/bookwyrm.target" -systemctl enable "${app}-beat.service" --quiet -systemctl enable "${app}-server.service" --quiet -systemctl enable "${app}-worker.service" --quiet +systemctl enable "bookwyrm-beat.service" --quiet +systemctl enable "bookwyrm-server.service" --quiet +systemctl enable "bookwyrm-worker.service" --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "${app}-beat" -yunohost service add "${app}-server" -yunohost service add "${app}-worker" +yunohost service add "bookwyrm-beat" +yunohost service add "bookwyrm-server" +yunohost service add "bookwyrm-worker" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="systemd" --line_match="Started" -ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" -ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="ready" +ynh_systemd_action --service_name="bookwyrm-beat" --action="start" --log_path="systemd" --line_match="Started" +ynh_systemd_action --service_name="bookwyrm-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" +ynh_systemd_action --service_name="bookwyrm-worker" --action="start" --log_path="systemd" --line_match="ready" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index f6ee5d6..654ca3e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,9 +28,9 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --action="stop" --service_name="${app}-beat" --log_path="systemd" --line_match="Stopped" -ynh_systemd_action --action="stop" --service_name="${app}-server" --log_path="systemd" --line_match="Stopped" -ynh_systemd_action --action="stop" --service_name="${app}-worker" --log_path="systemd" --line_match="Stopped" +ynh_systemd_action --action="stop" --service_name="bookwyrm-beat" --log_path="systemd" --line_match="Stopped" +ynh_systemd_action --action="stop" --service_name="bookwyrm-server" --log_path="systemd" --line_match="Stopped" +ynh_systemd_action --action="stop" --service_name="bookwyrm-worker" --log_path="systemd" --line_match="Stopped" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -89,12 +89,12 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 -ynh_add_config --template="../conf/${app}.target" --destination="/etc/systemd/system/$app.target" +ynh_add_config --template="../conf/bookwyrm.target" --destination="/etc/systemd/system/$app.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="${app}-server" --template="${app}-server.service" -ynh_add_systemd_config --service="${app}-worker" --template="${app}-worker.service" -ynh_add_systemd_config --service="${app}-beat" --template="${app}-beat.service" +ynh_add_systemd_config --service="bookwyrm-server" --template="bookwyrm-server.service" +ynh_add_systemd_config --service="bookwyrm-worker" --template="bookwyrm-worker.service" +ynh_add_systemd_config --service="bookwyrm-beat" --template="bookwyrm-beat.service" #================================================= # GENERIC FINALIZATION @@ -103,18 +103,18 @@ ynh_add_systemd_config --service="${app}-beat" --template="${app}-beat.service #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "${app}-beat" -yunohost service add "${app}-server" -yunohost service add "${app}-worker" +yunohost service add "bookwyrm-beat" +yunohost service add "bookwyrm-server" +yunohost service add "bookwyrm-worker" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="systemd" --line_match="Started" -ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" -ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="ready" +ynh_systemd_action --service_name="bookwyrm-beat" --action="start" --log_path="systemd" --line_match="Started" +ynh_systemd_action --service_name="bookwyrm-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid" +ynh_systemd_action --service_name="bookwyrm-worker" --action="start" --log_path="systemd" --line_match="ready" #================================================= # END OF SCRIPT