diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-12 14:39:39 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-12 14:39:39 -0800 |
commit | 1e4e24c7a635c76278f48e43ae15d7045d7eb08f (patch) | |
tree | 94af70466b871c352a41126864359c487a416855 /scripts | |
parent | 985778af972d1ec074802604c819663af54e499e (diff) | |
download | vyatta-cfg-system-1e4e24c7a635c76278f48e43ae15d7045d7eb08f.tar.gz vyatta-cfg-system-1e4e24c7a635c76278f48e43ae15d7045d7eb08f.zip |
Fix is_supported_speed matching
Typo in sprintf (perl doesn't have %c).
Also improve error messages.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 982cf0ee..009db451 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -644,7 +644,7 @@ sub set_speed_duplex { sub is_supported_speed { my ($dev, $speed, $duplex) = @_; - my $wanted = sprintf("%dbase%c/%s", $speed, + my $wanted = sprintf("%dbase%s/%s", $speed, ($speed == 2500) ? 'X' : 'T', ucfirst($duplex)); open( my $ethtool, '-|', "$ETHTOOL $dev 2>/dev/null" ) @@ -682,13 +682,13 @@ sub check_speed_duplex { # most basic and default case exit 0 if ($speed eq 'auto' && $duplex eq 'auto'); - die "if speed is hardcoded, duplex must also be hardcoded\n" + die "If speed is hardcoded, duplex must also be hardcoded\n" if ($duplex eq 'auto'); - die "if duplex is hardcoded, speed must also be hardcoded\n" + die "If duplex is hardcoded, speed must also be hardcoded\n" if ($speed eq 'auto'); - die "$speed not supported on $dev\n" + die "Speed $speed, duplex $duplex not supported on $dev\n" unless is_supported_speed($dev, $speed, $duplex); exit 0; |