From 8bdaedfde749ec3ca21e879d422d5183ed82e418 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Thu, 23 May 2024 23:51:02 +0200 Subject: [PATCH] Update helpers/systemd Co-authored-by: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> --- helpers/systemd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helpers/systemd b/helpers/systemd index 5c19610db..eb73f8187 100644 --- a/helpers/systemd +++ b/helpers/systemd @@ -92,8 +92,9 @@ ynh_systemd_action() { fi # do not start a service disabled by the user - if [ "$action" == "start" ] || [ "$action" == "reload_or_restart" ] || [ "$action" == "restart" ] && \ - ! yunohost service status $service_name | grep -q "start_on_boot: disabled"; then + if ([ "$action" == "start" ] || [ "$action" == "reload_or_restart" ] || [ "$action" == "restart" ]) && \ + ! systemctl --quiet is-enabled $service_name; then + echo "$service_name is disabled, therefore skipping action $action" return 0 fi