Sha256: 5f60da186c57e8b0bee8077226d2fb90612f1eff5a0314d811036d08865259c7

Contents?: true

Size: 406 Bytes

Versions: 1

Compression:

Stored size: 406 Bytes

Contents

require 'nokogiri'

class LinuxAdmin
  class Rhn < LinuxAdmin
    def self.systemid_file
      "/etc/sysconfig/rhn/systemid"
    end

    def self.registered?
      id = ""
      if File.exists?(systemid_file)
        xml = Nokogiri.XML(File.read(systemid_file))
        id = xml.xpath('/params/param/value/struct/member[name="system_id"]/value/string').text
      end
      id.length > 0
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
linux_admin-0.1.0 lib/linux_admin/rhn.rb