Sha256: fb74a55a25a396189c72c2012773eef6bb6f0476507db36aaf15a13bafb350e3

Contents?: true

Size: 492 Bytes

Versions: 2

Compression:

Stored size: 492 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

end; end; end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dns_one-0.4.8 lib/dns_one/util.rb
dns_one-0.4.7 lib/dns_one/util.rb