mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-10-23 07:42:05 +00:00
Fixed selinux detection issue
This commit is contained in:
@@ -810,8 +810,16 @@ get_system_info() {
|
||||
# SELinux Status
|
||||
if command -v getenforce >/dev/null 2>&1; then
|
||||
selinux_status=$(getenforce 2>/dev/null | tr '[:upper:]' '[:lower:]')
|
||||
# Map "enforcing" to "enabled" for server validation
|
||||
if [[ "$selinux_status" == "enforcing" ]]; then
|
||||
selinux_status="enabled"
|
||||
fi
|
||||
elif [[ -f /etc/selinux/config ]]; then
|
||||
selinux_status=$(grep "^SELINUX=" /etc/selinux/config | cut -d'=' -f2 | tr '[:upper:]' '[:lower:]')
|
||||
# Map "enforcing" to "enabled" for server validation
|
||||
if [[ "$selinux_status" == "enforcing" ]]; then
|
||||
selinux_status="enabled"
|
||||
fi
|
||||
else
|
||||
selinux_status="disabled"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user