Class: Specinfra::Command::Openbsd::Base::Interface
- Inherits:
-
Base::Interface
- Object
- Base
- Base::Interface
- Specinfra::Command::Openbsd::Base::Interface
- Defined in:
- lib/specinfra/command/openbsd/base/interface.rb
Class Method Summary collapse
- .check_has_ipv4_address(interface, ip_address) ⇒ Object
- .check_has_ipv6_address(interface, ip_address) ⇒ Object
- .get_speed_of(name) ⇒ Object
Methods inherited from Base
Class Method Details
.check_has_ipv4_address(interface, ip_address) ⇒ Object
7 8 9 |
# File 'lib/specinfra/command/openbsd/base/interface.rb', line 7 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
11 12 13 |
# File 'lib/specinfra/command/openbsd/base/interface.rb', line 11 def check_has_ipv6_address(interface, ip_address) "ifconfig #{interface} | grep -w inet6 | cut -d ' ' -f 2" end |
.get_speed_of(name) ⇒ Object
3 4 5 |
# File 'lib/specinfra/command/openbsd/base/interface.rb', line 3 def get_speed_of(name) "ifconfig #{name} | grep 'media\:' | perl -pe 's|.*media\:.*\\((.*?)\\)|\\1|'" end |