Class: Specinfra::Command::Base::Group

Inherits:
Specinfra::Command::Base show all
Defined in:
lib/specinfra/command/base/group.rb

Direct Known Subclasses

Aix::Base::Group, Solaris::Base::Group

Class Method Summary collapse

Methods inherited from Specinfra::Command::Base

create, escape

Class Method Details

.check_exists(group) ⇒ Object



3
4
5
# File 'lib/specinfra/command/base/group.rb', line 3

def check_exists(group)
  "getent group #{escape(group)}"
end

.check_has_gid(group, gid) ⇒ Object



7
8
9
10
# File 'lib/specinfra/command/base/group.rb', line 7

def check_has_gid(group, gid)
  regexp = "^#{group}"
  "getent group | grep -w -- #{escape(regexp)} | cut -f 3 -d ':' | grep -w -- #{escape(gid)}"
end