feat: add check for SELinux presence and log message if not found
Some checks failed
Nix Format Check / check-format (push) Failing after 38s

This commit is contained in:
Menno van Leeuwen 2025-03-10 15:11:15 +01:00
parent b20386462a
commit 51f2b2b145
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE

View File

@ -229,6 +229,12 @@ check_selinux() {
return 0
fi
# Check if getenforce exists, if not it means we don't have SELinux
if ! command -v getenforce >/dev/null 2>&1; then
log_success "SELinux not found. Skipping..."
return 0
fi
# Check if getenforce is returning Enforcing
if [ "$(getenforce)" = "Enforcing" ]; then
log_warning "SELinux is enabled. Adjusting SELinux to permissive mode..."