Skip to content

[Feature Request]: check/ck_selinux: check if current selinux status is given value #82

@aronchanisme

Description

@aronchanisme

Is there an existing issue for the feature request?

  • I have checked the existing issues.

Feature Description

check if current selinux status is given value

usage: 
check/ck_selinux.sh <status>, where,
status: on|off , e.g. off(default)

example:
check/ck_selinux.sh
check/ck_selinux.sh off
check/ck_selinux.sh on

output:
return 0: if matches given status
return 1: otherwise

Feature Implementation

selinux_status_1=`sestatus | awk '{print $NF}'`  # disabled|enabled
selinux_status_2=`getenforce`  # Disabled|Enforcing|Permissive

Note: command sestatus and getenforce might be missing, if so consider it as disabled

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions