summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-04-05 22:12:36 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-04-05 22:12:36 -0700
commit0fb08a6fe292821630d54754683a853c09e5fcc5 (patch)
tree6f79ff2522203d08e8c612d19a5293c4c42f4394
parent436fef67c98d69e8076a0cea8d00132132bb5a6d (diff)
parent0f258c68899fa3f48315c92225db8762ac73c4a5 (diff)
downloadvyatta-cfg-system-0fb08a6fe292821630d54754683a853c09e5fcc5.tar.gz
vyatta-cfg-system-0fb08a6fe292821630d54754683a853c09e5fcc5.zip
Merge branch 'larkspur' of vm:git/vyatta-cfg-system into larkspur
-rwxr-xr-xscripts/vyatta-interfaces.pl13
-rwxr-xr-xscripts/vyatta-load-user-key.pl2
2 files changed, 8 insertions, 7 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl
index 5b7f2cee..90d8dfc7 100755
--- a/scripts/vyatta-interfaces.pl
+++ b/scripts/vyatta-interfaces.pl
@@ -546,7 +546,7 @@ sub show_config_path {
sub get_ethtool {
my $dev = shift;
- open( my $ethtool, "sudo /usr/sbin/ethtool $dev 2>/dev/null |" )
+ open( my $ethtool, "-|", "sudo /usr/sbin/ethtool $dev 2>/dev/null" )
or die "ethtool failed: $!\n";
# ethtool produces:
@@ -588,13 +588,14 @@ sub set_speed_duplex {
}
}
- my @cmd = ('sudo', 'ethtool', '-s', $intf );
+ my $cmd = "sudo /usr/sbin/ethtool -s $intf";
if ($nspeed eq 'auto') {
- push @cmd, qw(autoneg on);
+ $cmd .= " autoneg on";
} else {
- push @cmd, 'speed', $nspeed, 'duplex', $nduplex, 'autoneg', 'off';
+ $cmd .= " speed $nspeed duplex $nduplex autoneg off";
}
- exec @cmd;
- die "Command failed: ", join(' ', @cmd);
+ # ignore errors since many devices don't allow setting speed/duplex
+ $cmd .= " 2>/dev/null";
+ system ($cmd);
}
diff --git a/scripts/vyatta-load-user-key.pl b/scripts/vyatta-load-user-key.pl
index 29163f6a..d64dba8a 100755
--- a/scripts/vyatta-load-user-key.pl
+++ b/scripts/vyatta-load-user-key.pl
@@ -71,7 +71,7 @@ sub geturl {
}
$cmd .= " $url";
- open (my $curl, "$cmd |" )
+ open (my $curl, "-|", $cmd )
or die "$cmd command failed: $!";
return $curl;