module CommandKit::OS::Linux::ClassMethods

Public Instance Methods

linux_distro() click to toggle source

Determines the specific Linux distro.

@return [:fedora, :redhat, :debian, :suse, :arch, nil]

Returns the type of Linux distro or `nil` if the Linux distro could
not be determined.

@api semipublic

# File lib/command_kit/os/linux.rb, line 67
def linux_distro
  if    File.file?('/etc/fedora-release') then :fedora
  elsif File.file?('/etc/redhat-release') then :redhat
  elsif File.file?('/etc/debian_version') then :debian
  elsif File.file?('/etc/SuSE-release')   then :suse
  elsif File.file?('/etc/arch-release')   then :arch
  end
end