MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 18.217.207.112
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/ruby/vendor_ruby/facter/util/partitions/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/ruby/vendor_ruby/facter/util/partitions/openbsd.rb
module Facter::Util::Partitions
  module OpenBSD
    def self.list
      Facter::Core::Execution.exec('df').scan(/\/dev\/(\S+)/).flatten
    end

    # On OpenBSD partitions don't have a UUID; disks have DUID but that's not
    # compatible.
    def self.uuid(partition)
      nil
    end

    def self.mount(partition)
      scan_mount(/\/dev\/#{partition}\son\s(\S+)/)
    end

    # Reported size is in 1K blocks
    def self.size(partition)
      scan_df(/\/dev\/#{partition}\s+(\S+)/)
    end

    def self.filesystem(partition)
      scan_mount(/\/dev\/#{partition}\son\s\S+\stype\s(\S+)/)
    end
   
    # On OpenBSD there are no labels for partitions
    def self.label(partition)
      nil
    end

    private
    def self.scan_mount(scan_regex)
      Facter::Core::Execution.exec('mount').scan(scan_regex).flatten.first
    end

    def self.scan_df(scan_regex)
      Facter::Core::Execution.exec('df -k').scan(scan_regex).flatten.first
    end
  end
end

MMCT - 2023