private static boolean isEnabled(){
  if (SystemUtils.IS_OS_WINDOWS) {
    return false;
  }
  try {
    List<String> lines=CommandUtil.executeCommandAndGetLines(Collections.singletonList("sestatus"));
    for (    String line : lines) {
      if (line.contains("SELinux status")) {
        if (line.contains("enabled")) {
          Logger.info("SELinux is enabled on this system");
          return true;
        }
        return false;
      }
    }
  }
 catch (  Exception ex) {
  }
  return false;
}

private static boolean isEnabled ( ) { if ( SystemUtils . IS_OS_WINDOWS ) { return false ; } try { List < String > lines = CommandUtil . executeCommandAndGetLines ( Collections . singletonList ( "sestatus" ) ) ; for ( String line : lines ) { if ( line . contains ( "SELinux status" ) ) { if ( line . contains ( "enabled" ) ) { Logger . info ( "SELinux is enabled on this system" ) ; return true ; } return false ; } } } catch ( Exception ex ) { } return false ; }
check whether selinux is enabled or not .
