Kanrisuru

delete_group

Delete a group in ruby
linux manual

Basic Usage

host = Kanrisuru::Remote::Host.new(host: '127.0.1.1', username: 'ubuntu', keys: ['~/.ssh/id_rsa'])

result = host.delete_group('kanrisuru')
result.success?
true

host.group?('kanrisuru')
false

Parameters

Field Type Description
group string
integer
Required name / gid of the group to delete.

Result

No explicit data struct returned, only option is success?, failure?, and status to see if the program exited properly.

Exit Status

Code Description
0 Success
2 Invalid command syntax
6 Specified group doesn't exist
8 Can't remove user's primary group
10 Can't update group file

Tested On

  • Ubuntu, Debian, Centos, Fedora, Redhat, OpenSuse, SLES