Sha256: 61e8bdbe85357dc0de424f32b5c3346302614d2c75599364974b1c31dc76e4f8

Contents?: true

Size: 558 Bytes

Versions: 31

Compression:

Stored size: 558 Bytes

Contents

module DnsOne; class Util; class << self

  def die msg
    Log.f msg
    exit 1
  end

  def run cmd
      puts "Running #{cmd}..."
      system cmd
  end

  def has_systemd?
      File.exist?(`which systemctl`.strip) && 
      File.writable?('/lib/systemd/system')
  end

  def ensure_sytemd
      unless has_systemd?
          STDERR.puts "Systemd not available. Aborting." 
          exit 1
      end
  end

  def match_root stat
      stat.uid == 0 && stat.gid == 0
  end

  def last_mod constant
    constant.to_s.split('::').last
  end

end; end; end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
dns_one-0.4.41 lib/dns_one/util.rb
dns_one-0.4.40 lib/dns_one/util.rb
dns_one-0.4.39 lib/dns_one/util.rb
dns_one-0.4.37 lib/dns_one/util.rb
dns_one-0.4.36 lib/dns_one/util.rb
dns_one-0.4.35 lib/dns_one/util.rb
dns_one-0.4.34 lib/dns_one/util.rb
dns_one-0.4.33 lib/dns_one/util.rb
dns_one-0.4.32 lib/dns_one/util.rb
dns_one-0.4.31 lib/dns_one/util.rb
dns_one-0.4.30 lib/dns_one/util.rb
dns_one-0.4.29 lib/dns_one/util.rb
dns_one-0.4.28 lib/dns_one/util.rb
dns_one-0.4.27 lib/dns_one/util.rb
dns_one-0.4.26 lib/dns_one/util.rb
dns_one-0.4.25 lib/dns_one/util.rb
dns_one-0.4.24 lib/dns_one/util.rb
dns_one-0.4.23 lib/dns_one/util.rb
dns_one-0.4.22 lib/dns_one/util.rb
dns_one-0.4.21 lib/dns_one/util.rb