diff options
Diffstat (limited to 'lib/Vyatta/Interface.pm')
-rwxr-xr-x | lib/Vyatta/Interface.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Vyatta/Interface.pm b/lib/Vyatta/Interface.pm index 97ef7f7..8107eff 100755 --- a/lib/Vyatta/Interface.pm +++ b/lib/Vyatta/Interface.pm @@ -222,6 +222,17 @@ sub flags { return hex($val); } +sub carrier { + my $self = shift; + open my $carrier, '<', "/sys/class/net/$self->{name}/carrier" + or return; + + my $val = <$carrier>; + chomp $val; + close $carrier; + return $carrier; +} + sub hw_address { my $self = shift; |