File: interface.rb

package info (click to toggle)
ruby-specinfra 2.94.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,464 kB
  • sloc: ruby: 10,562; makefile: 4
file content (11 lines) | stat: -rw-r--r-- 373 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
class Specinfra::Command::Freebsd::V11::Interface < Specinfra::Command::Freebsd::Base::Interface
  class << self
    def get_ipv4_address(interface)
      "ifconfig -f inet:cidr #{interface} inet | awk '/inet /{print $2}'"
    end

    def get_ipv6_address(interface)
      "ifconfig -f inet6:cidr #{interface} inet6 | awk '/inet6 /{print $2}' | tail -1"
    end
  end
end