Class: Specinfra::Command::Openbsd::Base::Interface

Inherits:
Base::Interface show all
Defined in:
lib/specinfra/command/openbsd/base/interface.rb

Class Method Summary collapse

Methods inherited from Base

create, escape

Class Method Details

.check_exists(name) ⇒ Object



3
4
5
# File 'lib/specinfra/command/openbsd/base/interface.rb', line 3

def check_exists(name)
  "ifconfig #{name}"
end

.check_has_ipv4_address(interface, ip_address) ⇒ Object



11
12
13
# File 'lib/specinfra/command/openbsd/base/interface.rb', line 11

def check_has_ipv4_address(interface, ip_address)
  "ifconfig #{interface} | grep -w inet | cut -d ' ' -f 2"
end

.check_has_ipv6_address(interface, ip_address) ⇒ Object



15
16
17
# File 'lib/specinfra/command/openbsd/base/interface.rb', line 15

def check_has_ipv6_address(interface, ip_address)
  "ifconfig #{interface} | grep -w inet6 | cut -d ' ' -f 2"
end

.get_speed_of(name) ⇒ Object



7
8
9
# File 'lib/specinfra/command/openbsd/base/interface.rb', line 7

def get_speed_of(name)
  "ifconfig #{name} | grep 'media\:' | perl -pe 's|.*media\:.*\\((.*?)\\)|\\1|'"
end