From 1cade2e375bf6e1f01a408c90e01d6fbb0ef0e24 Mon Sep 17 00:00:00 2001 From: Thibault Ayanides Date: Tue, 27 Apr 2021 13:49:05 +0200 Subject: [PATCH] FIX(2.2.1.2): custom func not working for systemd (#90) fix #87 --- bin/hardening/2.2.1.2_configure_systemd-timesyncd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/hardening/2.2.1.2_configure_systemd-timesyncd.sh b/bin/hardening/2.2.1.2_configure_systemd-timesyncd.sh index 03b2e9f..6bbb561 100755 --- a/bin/hardening/2.2.1.2_configure_systemd-timesyncd.sh +++ b/bin/hardening/2.2.1.2_configure_systemd-timesyncd.sh @@ -21,8 +21,8 @@ SERVICE_NAME="systemd-timesyncd" # This function will be called if the script status is on enabled / audit mode audit() { - is_service_enabled "$SERVICE_NAME" - if [ "$FNRET" = 0 ]; then + status=$(systemctl is-enabled "$SERVICE_NAME") + if [ "$status" = "enabled" ]; then ok "$SERVICE_NAME is enabled" else crit "$SERVICE_NAME is disabled"