From 15d1156187c4bdab384c3ef4014d28c8366ce021 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 15 Dec 2025 18:22:48 +0100 Subject: [PATCH] Fis error in determin if systemd support is present in case of debian 13 and newer. --- check_cert_for_dovecot.sh | 2 +- check_cert_for_keycloak.sh | 2 +- check_cert_for_prosody.sh | 2 +- check_cert_for_service.sh | 2 +- check_clamav-services.sh | 7 ++++--- check_clamavd.sh | 2 +- check_confluence.sh | 2 +- check_cups-browsed.sh | 2 +- check_cups.sh | 2 +- check_dhcp.sh | 2 +- check_dns.sh | 2 +- check_dovecot.sh | 2 +- check_freshclam.sh | 2 +- check_local_webservice.sh | 2 +- check_networking.sh | 2 +- check_nginx_service.sh | 2 +- check_ntpd.sh | 2 +- check_ntpsec_service.sh | 2 +- check_postfix.sh | 2 +- check_postfwd.sh | 2 +- check_postgrey.sh | 2 +- check_remote_websites.sh | 2 +- check_samba4_service.sh | 2 +- check_service.sh | 2 +- check_ssh.sh | 2 +- check_sympa_service.sh | 2 +- check_systemd_service.sh | 2 +- check_vpn.sh | 2 +- check_webservice_load.sh | 2 +- check_wwsympa_service.sh | 2 +- testscript-running-30-seconds-with-dynamic-LOCK_DIR.sh | 2 +- testscript-running-30-seconds-with-static-LOCK_DIR.sh | 2 +- 32 files changed, 35 insertions(+), 34 deletions(-) diff --git a/check_cert_for_dovecot.sh b/check_cert_for_dovecot.sh index 5673e18..3ec84f6 100755 --- a/check_cert_for_dovecot.sh +++ b/check_cert_for_dovecot.sh @@ -227,7 +227,7 @@ systemd_supported=false systemd=$(which systemd) systemctl=$(which systemctl) -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_cert_for_keycloak.sh b/check_cert_for_keycloak.sh index 7d5c85b..51b2520 100755 --- a/check_cert_for_keycloak.sh +++ b/check_cert_for_keycloak.sh @@ -190,7 +190,7 @@ systemd_supported=false systemd=$(which systemd) systemctl=$(which systemctl) -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_cert_for_prosody.sh b/check_cert_for_prosody.sh index e7e979b..be8fb64 100755 --- a/check_cert_for_prosody.sh +++ b/check_cert_for_prosody.sh @@ -177,7 +177,7 @@ systemd_supported=false systemd=$(which systemd) systemctl=$(which systemctl) -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_cert_for_service.sh b/check_cert_for_service.sh index 11f9dc0..44d23ff 100755 --- a/check_cert_for_service.sh +++ b/check_cert_for_service.sh @@ -163,7 +163,7 @@ systemd_supported=false systemd=$(which systemd) systemctl=$(which systemctl) -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_clamav-services.sh b/check_clamav-services.sh index 149272e..8392643 100755 --- a/check_clamav-services.sh +++ b/check_clamav-services.sh @@ -89,9 +89,10 @@ fi # - Is this a systemd system? # - -if [[ "X`which systemd`" = "X" ]]; then - systemd_exists=false -else +systemd=$(which systemd) +systemctl=$(which systemctl) + +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_exists=true fi diff --git a/check_clamavd.sh b/check_clamavd.sh index 64387a7..152aec6 100755 --- a/check_clamavd.sh +++ b/check_clamavd.sh @@ -134,7 +134,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_confluence.sh b/check_confluence.sh index 919c299..4631c84 100755 --- a/check_confluence.sh +++ b/check_confluence.sh @@ -116,7 +116,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_cups-browsed.sh b/check_cups-browsed.sh index 28c5629..1af648e 100755 --- a/check_cups-browsed.sh +++ b/check_cups-browsed.sh @@ -145,7 +145,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_cups.sh b/check_cups.sh index 2e6308d..cd54b2c 100755 --- a/check_cups.sh +++ b/check_cups.sh @@ -145,7 +145,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_dhcp.sh b/check_dhcp.sh index 3b4de0f..b5848f7 100755 --- a/check_dhcp.sh +++ b/check_dhcp.sh @@ -145,7 +145,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_dns.sh b/check_dns.sh index 2f0b568..df31120 100755 --- a/check_dns.sh +++ b/check_dns.sh @@ -172,7 +172,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true else if [[ ! -x $bind_init_script ]]; then diff --git a/check_dovecot.sh b/check_dovecot.sh index f251eb7..6699684 100755 --- a/check_dovecot.sh +++ b/check_dovecot.sh @@ -115,7 +115,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_freshclam.sh b/check_freshclam.sh index 914694b..d8adf4f 100755 --- a/check_freshclam.sh +++ b/check_freshclam.sh @@ -134,7 +134,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_local_webservice.sh b/check_local_webservice.sh index e9fc109..af86af9 100755 --- a/check_local_webservice.sh +++ b/check_local_webservice.sh @@ -317,7 +317,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_networking.sh b/check_networking.sh index 9ff1a3f..8411806 100755 --- a/check_networking.sh +++ b/check_networking.sh @@ -151,7 +151,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true else fatal "Support of systemd is requirred for this script" diff --git a/check_nginx_service.sh b/check_nginx_service.sh index 26e26ec..b1d4c35 100755 --- a/check_nginx_service.sh +++ b/check_nginx_service.sh @@ -151,7 +151,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_ntpd.sh b/check_ntpd.sh index 744adf5..7f4fc3a 100755 --- a/check_ntpd.sh +++ b/check_ntpd.sh @@ -145,7 +145,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_ntpsec_service.sh b/check_ntpsec_service.sh index 923b2fa..8e3b82a 100755 --- a/check_ntpsec_service.sh +++ b/check_ntpsec_service.sh @@ -151,7 +151,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_postfix.sh b/check_postfix.sh index 0d05292..84c6b46 100755 --- a/check_postfix.sh +++ b/check_postfix.sh @@ -145,7 +145,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true else if [[ ! -x $postfix_init_script ]]; then diff --git a/check_postfwd.sh b/check_postfwd.sh index f0da371..0eeb045 100755 --- a/check_postfwd.sh +++ b/check_postfwd.sh @@ -134,7 +134,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_postgrey.sh b/check_postgrey.sh index b11e3db..6968968 100755 --- a/check_postgrey.sh +++ b/check_postgrey.sh @@ -134,7 +134,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_remote_websites.sh b/check_remote_websites.sh index 4437198..2fa4dce 100755 --- a/check_remote_websites.sh +++ b/check_remote_websites.sh @@ -186,7 +186,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_samba4_service.sh b/check_samba4_service.sh index 16c6439..01ac9c6 100755 --- a/check_samba4_service.sh +++ b/check_samba4_service.sh @@ -147,7 +147,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_service.sh b/check_service.sh index ed483d1..b6da24c 100755 --- a/check_service.sh +++ b/check_service.sh @@ -107,7 +107,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_ssh.sh b/check_ssh.sh index f591cd0..096cb56 100755 --- a/check_ssh.sh +++ b/check_ssh.sh @@ -110,7 +110,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_sympa_service.sh b/check_sympa_service.sh index d52a040..325a315 100755 --- a/check_sympa_service.sh +++ b/check_sympa_service.sh @@ -195,7 +195,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/check_systemd_service.sh b/check_systemd_service.sh index 0528c28..8fb54c6 100755 --- a/check_systemd_service.sh +++ b/check_systemd_service.sh @@ -240,7 +240,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true else fatal "Systemd is not present!" diff --git a/check_vpn.sh b/check_vpn.sh index f0d644d..ec6fa22 100755 --- a/check_vpn.sh +++ b/check_vpn.sh @@ -140,7 +140,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true else if [[ ! -x $init_script ]]; then diff --git a/check_webservice_load.sh b/check_webservice_load.sh index a6c7bdf..ce11a12 100755 --- a/check_webservice_load.sh +++ b/check_webservice_load.sh @@ -345,7 +345,7 @@ if ! $vserver_guest ; then systemd=$(which systemd) systemctl=$(which systemctl) - if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then + if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi fi diff --git a/check_wwsympa_service.sh b/check_wwsympa_service.sh index 7c1bef6..252d87f 100755 --- a/check_wwsympa_service.sh +++ b/check_wwsympa_service.sh @@ -189,7 +189,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/testscript-running-30-seconds-with-dynamic-LOCK_DIR.sh b/testscript-running-30-seconds-with-dynamic-LOCK_DIR.sh index 94fd4c6..89f9cbf 100755 --- a/testscript-running-30-seconds-with-dynamic-LOCK_DIR.sh +++ b/testscript-running-30-seconds-with-dynamic-LOCK_DIR.sh @@ -101,7 +101,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi diff --git a/testscript-running-30-seconds-with-static-LOCK_DIR.sh b/testscript-running-30-seconds-with-static-LOCK_DIR.sh index 633f6aa..d6da244 100755 --- a/testscript-running-30-seconds-with-static-LOCK_DIR.sh +++ b/testscript-running-30-seconds-with-static-LOCK_DIR.sh @@ -137,7 +137,7 @@ systemd=$(which systemd) systemctl=$(which systemctl) systemd_supported=false -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi