Class: Specinfra::Command::Linux::Base::SelinuxModule

Inherits:
Base::SelinuxModule show all
Defined in:
lib/specinfra/command/linux/base/selinux_module.rb

Class Method Summary collapse

Methods inherited from Base

create, escape

Class Method Details

.check_is_enabled(name) ⇒ Object


10
11
12
13
14
# File 'lib/specinfra/command/linux/base/selinux_module.rb', line 10

def check_is_enabled(name)
  cmd =  "semodule -l | grep $'^#{escape(name)}\\t'"
  cmd += " | grep -v $'^#{escape(name)}\\t.*\\tDisabled$'"
  cmd
end

.check_is_installed(name, version = nil) ⇒ Object


3
4
5
6
7
8
# File 'lib/specinfra/command/linux/base/selinux_module.rb', line 3

def check_is_installed(name, version=nil)
  cmd =  "semodule -l | grep $'^#{escape(name)}\\t"
  cmd += "#{escape(version)}\\t" unless version.nil?
  cmd += "'"
  cmd
end