diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-boot-image.pl | 2 | ||||
-rwxr-xr-x | scripts/vyatta-show-interfaces.pl | 12 |
2 files changed, 5 insertions, 9 deletions
diff --git a/scripts/vyatta-boot-image.pl b/scripts/vyatta-boot-image.pl index 19df5a2..555496b 100755 --- a/scripts/vyatta-boot-image.pl +++ b/scripts/vyatta-boot-image.pl @@ -192,7 +192,7 @@ sub deleteGrubEntries { die "Failed to modify GRUB configuration\n" if (!defined($p) || !chmod(($p & oct(7777)), $tfile)); - mv($tfile, $grub_cfg) + move($tfile, $grub_cfg) or die "Failed to delete GRUB entries\n"; } diff --git a/scripts/vyatta-show-interfaces.pl b/scripts/vyatta-show-interfaces.pl index 5a56050..36428cb 100755 --- a/scripts/vyatta-show-interfaces.pl +++ b/scripts/vyatta-show-interfaces.pl @@ -119,18 +119,14 @@ sub get_ipaddr { } sub get_state_link { - my $intf = shift; + my $name = shift; + my $intf = new Vyatta::Interface($name); my $state; my $link = 'down'; - my $flags = get_sysfs_value($intf, 'flags'); - my $hex_flags = hex($flags); - if ($hex_flags & 0x1) { # IFF_UP + if ($intf->up()) { $state = 'up'; - my $carrier = get_sysfs_value($intf, 'carrier'); - if ($carrier eq '1') { - $link = "up"; - } + $link = "up" if ($intf->running()); } else { $state = "admin down"; } |