Method: Specinfra::Command::Base::Port.check_is_listening
- Defined in:
- lib/specinfra/command/base/port.rb
permalink .check_is_listening(port, options = {}) ⇒ Object
[View source]
3 4 5 6 7 8 |
# File 'lib/specinfra/command/base/port.rb', line 3 def check_is_listening(port, ={}) pattern = ":#{port} " pattern = " #{[:local_address]}#{pattern}" if [:local_address] pattern = "^#{[:protocol]} .*#{pattern}" if [:protocol] "netstat -tunl | grep -- #{escape(pattern)}" end |