From bc1b1275c6e9e4da6ea8903603e922adbeb2ed0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sat, 25 May 2024 22:25:00 +0200 Subject: [PATCH] Cleanup packagingv2, debug --- scripts/install | 4 ++-- scripts/remove | 4 ++-- scripts/restore | 6 ++++-- scripts/upgrade | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index 63575b6..e221a7c 100755 --- a/scripts/install +++ b/scripts/install @@ -67,9 +67,9 @@ ynh_script_progression --message="Adding system configurations related to $app.. for suffix in "${systemd_services_suffixes[@]}"; do ynh_add_systemd_config --service="$app$suffix" --template="systemd$suffix.service" _ynh_add_config_j2 --template="systemd$suffix.timer.j2" --destination="/etc/systemd/system/$app$suffix.timer" - systemctl disable --quiet "${app}$suffix.service" + ynh_systemd_action --service="${app}$suffix.service" --action="disable" systemctl enable --quiet "${app}$suffix.timer" - systemctl start --quiet "${app}$suffix.timer" + ynh_systemd_action --service="${app}$suffix.timer" --action="start" yunohost service add "$app$suffix" --description="Restic backup program ($app$suffix)" \ --test_status="systemctl show $app$suffix.service -p ActiveState --value | grep -v failed" diff --git a/scripts/remove b/scripts/remove index b69166d..2384c09 100755 --- a/scripts/remove +++ b/scripts/remove @@ -18,8 +18,8 @@ for suffix in "${systemd_services_suffixes[@]}"; do if ynh_exec_warn_less yunohost service status "$app_suffix" >/dev/null; then yunohost service remove "$app_suffix" fi - systemctl stop "$app$suffix.timer" - systemctl --quiet disable "$app$suffix.timer" + ynh_systemd_action --service="$app$suffix.timer" --action="stop" + ynh_systemd_action --service="$app$suffix.timer" --action="disable" ynh_remove_systemd_config --service="$app$suffix" ynh_secure_remove "/etc/systemd/system/$app$suffix.timer" done diff --git a/scripts/restore b/scripts/restore index d3a8fc9..e1a6919 100755 --- a/scripts/restore +++ b/scripts/restore @@ -13,6 +13,8 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 +find '/home/yunohost.backup/tmp/Backup_test/apps/restic/backup' + ynh_restore_file --origin_path="$install_dir" ynh_setup_source --source_id=main --dest_dir="$install_dir" @@ -48,8 +50,8 @@ _set_ssh_config for suffix in "${systemd_services_suffixes[@]}"; do ynh_restore_file --origin_path="/etc/systemd/system/$app$suffix.timer" ynh_restore_file --origin_path="/etc/systemd/system/$app$suffix.service" - systemctl enable "$app$suffix.timer" - systemctl start "$app$suffix.timer" + systemctl enable --quiet "$app$suffix.timer" + ynh_systemd_action --service="$app$suffix.timer" --action="start" done #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5144da8..1c82855 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -37,8 +37,8 @@ ynh_script_progression --message="Stopping $app's systemd service..." --weight=1 if grep "${app}.timer" /etc/yunohost/services.yml > /dev/null ; then yunohost service remove $app.timer - systemctl --quiet enable $app.timer - systemctl start $app.timer + ynh_systemd_action --service="$app.timer" --action="enable" + ynh_systemd_action --service="$app.timer" --action="start" fi #=================================================