Module: Specinfra::Command::Module::Ss

Included in:
Redhat::V7::Port
Defined in:
lib/specinfra/command/module/ss.rb

Instance Method Summary collapse

Instance Method Details

#check_is_listening(port, options = {}) ⇒ Object



5
6
7
8
9
# File 'lib/specinfra/command/module/ss.rb', line 5

def check_is_listening(port, options={})
  pattern = ":#{port} "
  pattern = " #{inaddr_any_to_asterisk(options[:local_address])}#{pattern}" if options[:local_address]
  "ss #{command_options(options[:protocol])} | grep -- #{escape(pattern)}"
end