Class: Specinfra::Command::Solaris::Base::Port

Inherits:
Base::Port show all
Defined in:
lib/specinfra/command/solaris/base/port.rb

Class Method Summary collapse

Methods inherited from Base

create, escape

Class Method Details

.check_is_listening(port, opts = nil) ⇒ Object


3
4
5
6
# File 'lib/specinfra/command/solaris/base/port.rb', line 3

def check_is_listening(port, opts=nil)
  regexp = "\\.#{port} "
  "netstat -an 2> /dev/null | grep -- LISTEN | grep -- #{escape(regexp)}"
end

.check_is_listening_with_protocol(port, protocol) ⇒ Object


8
9
10
11
# File 'lib/specinfra/command/solaris/base/port.rb', line 8

def check_is_listening_with_protocol(port, protocol)
  regexp = ".*\\.#{port} "
  "netstat -an -P #{escape(protocol)} 2> /dev/null | grep -- LISTEN | grep -- #{escape(regexp)}"
end