Merge pull request #3353 from MichaIng/patch-1
Only check SELinux states if "getenforce" command exists
This commit is contained in:
commit
d524f9a73b
|
@ -1980,9 +1980,9 @@ checkSelinux() {
|
||||||
local DEFAULT_SELINUX
|
local DEFAULT_SELINUX
|
||||||
local CURRENT_SELINUX
|
local CURRENT_SELINUX
|
||||||
local SELINUX_ENFORCING=0
|
local SELINUX_ENFORCING=0
|
||||||
# Check if a SELinux configuration file exists
|
# Check for SELinux configuration file and getenforce command
|
||||||
if [[ -f /etc/selinux/config ]]; then
|
if [[ -f /etc/selinux/config ]] && command -v getenforce &> /dev/null; then
|
||||||
# If a SELinux configuration file was found, check the default SELinux mode.
|
# Check the default SELinux mode
|
||||||
DEFAULT_SELINUX=$(awk -F= '/^SELINUX=/ {print $2}' /etc/selinux/config)
|
DEFAULT_SELINUX=$(awk -F= '/^SELINUX=/ {print $2}' /etc/selinux/config)
|
||||||
case "${DEFAULT_SELINUX,,}" in
|
case "${DEFAULT_SELINUX,,}" in
|
||||||
enforcing)
|
enforcing)
|
||||||
|
|
Loading…
Reference in New Issue