add isSELINUX routine

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10335 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2011-08-22 11:50:44 +00:00
parent 26ee4cf110
commit 39c6fee693

View File

@ -6604,5 +6604,37 @@ sub runcmd_S
}
#-------------------------------------------------------------------------------
=head3 isSELINUX
Returns:
returns 0 if SELINUX is enabled
returns 1 if SELINUX is not enabled
Globals:
none
Error:
none
Example:
if (xCAT::Utils->isSELINUX()) { blah; }
Comments:
This is tested on Redhat, may need more for SLES
=cut
#-------------------------------------------------------------------------------
sub isSELINUX
{
if (-e "/usr/sbin/selinuxenabled") {
`/usr/sbin/selinuxenabled`;
if ($? == 0) {
return 0;
} else {
return 1;
}
} else {
return 1;
}
}
#-------------------------------------------------------------------------------
1;