diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2005-04-21 11:40:14 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2005-04-21 11:40:14 +0000 |
commit | b1199cc6b90b11ad492dd145934ad8086db4f757 (patch) | |
tree | a18bad1708f3a57cec9b2d482f59dd21bf5c4b25 /perl-install/standalone/drakroam | |
parent | e596c546fa236ac629608282098c3cc96584d09f (diff) | |
download | drakx-b1199cc6b90b11ad492dd145934ad8086db4f757.tar drakx-b1199cc6b90b11ad492dd145934ad8086db4f757.tar.gz drakx-b1199cc6b90b11ad492dd145934ad8086db4f757.tar.bz2 drakx-b1199cc6b90b11ad492dd145934ad8086db4f757.tar.xz drakx-b1199cc6b90b11ad492dd145934ad8086db4f757.zip |
(ConnectNow) simplify
Diffstat (limited to 'perl-install/standalone/drakroam')
-rwxr-xr-x | perl-install/standalone/drakroam | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/perl-install/standalone/drakroam b/perl-install/standalone/drakroam index a782bcb63..d8f360b7b 100755 --- a/perl-install/standalone/drakroam +++ b/perl-install/standalone/drakroam @@ -355,15 +355,10 @@ sub ConnectNow { my ($row) = @_; my @command = ""; push @command, "$IWConfig $device essid $KnownList->{data}[$row][0] "; - if ($KnownList->{data}[$row][1]) { - push @command, "mode $KnownList->{data}[$row][1] "; - } - if ($KnownList->{data}[$row][2]) { - push @command, "channel $KnownList->{data}[$row][2] "; - } - if ($KnownList->{data}[$row][4]) { - push @command, "key $KnownList->{data}[$row][4] "; - } + my %commands = (1 => 'mode', 2 => 'channel', 4 => 'key'); + foreach (my ($key, $cmd) = each %commands) { + push @command, "$cmd $KnownList->{data}[$row][$key] " if $KnownList->{data}[$row][$key]; + } push @command, "; "; if ($KnownList->{data}[$row][3]) { push @command, "$IFConfig $device up; $DHClient $device"; |