summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakroam
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-04-21 11:40:14 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-04-21 11:40:14 +0000
commitb1199cc6b90b11ad492dd145934ad8086db4f757 (patch)
treea18bad1708f3a57cec9b2d482f59dd21bf5c4b25 /perl-install/standalone/drakroam
parente596c546fa236ac629608282098c3cc96584d09f (diff)
downloaddrakx-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-xperl-install/standalone/drakroam13
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";