Sha256: 25bdc09396dfb0700eaff047eb2b9fe7b636f0dfdb16ccd333c9101350e2bcf1

Contents?: true

Size: 633 Bytes

Versions: 1

Compression:

Stored size: 633 Bytes

Contents

class Specinfra::Command::Solaris::Base::Service < Specinfra::Command::Base::Service
  class << self
    def check_is_enabled(service, level=nil)
      "svcs -l #{escape(service)} 2> /dev/null | egrep '^enabled *true$'"
    end

    def check_is_running(service)
      "svcs -l #{escape(service)} status 2> /dev/null | egrep '^state *online$'"
    end

    def check_has_property(svc, property)
      commands = []
      property.sort.each do |key, value|
        regexp = "^#{value}$"
        commands << "svcprop -p #{escape(key)} #{escape(svc)} | grep -- #{escape(regexp)}"
      end
      commands.join(' && ')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
specinfra-2.2.1 lib/specinfra/command/solaris/base/service.rb