From b6fff5b8b6abd7492883752b7b28ca4eb41b40a3 Mon Sep 17 00:00:00 2001 From: Thibault Ayanides Date: Thu, 24 Dec 2020 16:20:12 +0100 Subject: [PATCH] ADD(2.2.1.2): add systemd-timesyncd --- bin/hardening/2.2.1.2_configure_systemd-timesyncd.sh | 11 +++++++++-- 1 file changed, 9 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 67d8067..03b2e9f 100755 --- a/bin/hardening/2.2.1.2_configure_systemd-timesyncd.sh +++ b/bin/hardening/2.2.1.2_configure_systemd-timesyncd.sh @@ -13,13 +13,20 @@ set -e # One error, it's over set -u # One variable unset, it's over # shellcheck disable=2034 -HARDENING_LEVEL=3 +HARDENING_LEVEL=4 # shellcheck disable=2034 DESCRIPTION="Configure systemd-timesyncd." +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 + ok "$SERVICE_NAME is enabled" + else + crit "$SERVICE_NAME is disabled" + fi } # This function will be called if the script status is on enabled mode