From be5491f56598f77d760138f39f79fa7c5c443462 Mon Sep 17 00:00:00 2001 From: Allen Golbig Date: Thu, 29 Jan 2026 11:52:11 -0500 Subject: [PATCH] sync check/fix from tahoe --- rules/os/os_httpd_disable.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/rules/os/os_httpd_disable.yaml b/rules/os/os_httpd_disable.yaml index 1da12743..511bb0d2 100644 --- a/rules/os/os_httpd_disable.yaml +++ b/rules/os/os_httpd_disable.yaml @@ -5,12 +5,24 @@ discussion: | NOTE: The built in web server service is disabled at startup by default macOS. check: | - /bin/launchctl print-disabled system | /usr/bin/grep -c '"org.apache.httpd" => disabled' + result="FAIL" + enabled=$(/bin/launchctl print-disabled system | /usr/bin/grep '"org.apache.httpd" => enabled') + running=$(/bin/launchctl print system/org.apache.httpd 2>/dev/null) + + if [[ -z "$running" ]] && [[ -z "$enabled" ]]; then + result="PASS" + elif [[ -n "$running" ]]; then + result=result+" RUNNING" + elif [[ -n "$enabled" ]]; then + result=result+" ENABLED" + fi + echo $result result: - integer: 1 + string: PASS fix: | [source,bash] ---- + /usr/sbin/apachectl stop 2>/dev/null /bin/launchctl disable system/org.apache.httpd ---- references: