File: ip6tables.rb

package info (click to toggle)
ruby-specinfra 2.94.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,448 kB
  • sloc: ruby: 10,538; sh: 4; makefile: 4
file content (15 lines) | stat: -rw-r--r-- 475 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Specinfra::Command::Linux::Base::Ip6tables < Specinfra::Command::Base::Ip6tables
  class << self
    def check_has_rule(rule, table=nil, chain=nil)
      cmd = "ip6tables"
      cmd += " -t #{escape(table)}" if table
      cmd += " -S"
      cmd += " #{escape(chain)}" if chain
      cmd += " | grep -- #{escape(rule)}"
      cmd += " || ip6tables-save"
      cmd += " -t #{escape(table)}" if table
      cmd += " | grep -- #{escape(rule)}"
      cmd
    end
  end
end