Class: Specinfra::Command::Solaris::Base::Port
- Inherits:
-
Base::Port
- Object
- Base
- Base::Port
- Specinfra::Command::Solaris::Base::Port
- Defined in:
- lib/specinfra/command/solaris/base/port.rb
Class Method Summary collapse
- .check_is_listening(port, opts = nil) ⇒ Object
- .check_is_listening_with_protocol(port, protocol) ⇒ Object
Methods inherited from Base
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 |