summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakroam
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/drakroam')
-rwxr-xr-xperl-install/standalone/drakroam28
1 files changed, 14 insertions, 14 deletions
diff --git a/perl-install/standalone/drakroam b/perl-install/standalone/drakroam
index 3fddd18be..5e7d36a33 100755
--- a/perl-install/standalone/drakroam
+++ b/perl-install/standalone/drakroam
@@ -65,7 +65,7 @@ my %available_roaming_daemons = (
each_index {
/^#/ || /^\n/ and next; #ignore comments and blank lines
if (/^(\S+)\s+(.*)$/) {
- my ($essid, $mode, $channel, $key, $dhcp);
+ my ($essid, $mode, $channel, $dhcp, $key);
my $command = $2;
# setup new network entry
$essid = $1;
@@ -73,7 +73,7 @@ my %available_roaming_daemons = (
($channel) = $command =~ /channel\s([^\s;]+)/;
($key) = $command =~ /key\s([^\s;]+)/;
$dhcp = $command =~ /dhclient/;
- &AddNet($essid, $mode, $channel, $key, $dhcp);
+ &AddNet($essid, $mode, $channel, $dhcp, $key);
}
else { die "Line $::i of configuration file is not parseable.\n" }
} cat_($config)
@@ -90,8 +90,8 @@ my %available_roaming_daemons = (
my $iwc = join(' ', $IWConfig, "essid $essid",
if_($row->[1], "mode $row->[1]"),
if_($row->[2], "channel $row->[2]"),
- if_($row->[3], "key $row->[3]"));
- my $ifc = $row->[4] ? "$IFConfig \@DEV\@ up; $DHClient \@DEV\@" : "$IFUp \@DEV\@";
+ if_($row->[4], "key $row->[4]"));
+ my $ifc = $row->[3] ? "$IFConfig \@DEV\@ up; $DHClient \@DEV\@" : "$IFUp \@DEV\@";
push @contents, "$essid\t\t$iwc; $ifc\n";
}
output_p($config, @contents);
@@ -135,15 +135,15 @@ $ScanEntry->set_text($ScanInterval);
$KnownList = Gtk2::SimpleList->new(
"ESSID" => "text",
"Mode" => "text",
- "Channel" => "int",
- "Key" => "text",
- "DHCP" => "bool"
+ "Channel" => "text",
+ "DHCP" => "bool",
+ "Key" => "text"
);
$KnownList->get_selection->set_mode('single');
$KnownList->set_reorderable(1);
$KnownList->set_column_editable(1, TRUE); # allow to change mode
$KnownList->set_column_editable(2, TRUE); # allow to change channel
-$KnownList->set_column_editable(3, TRUE); # allow to change key
+$KnownList->set_column_editable(4, TRUE); # allow to change key
$AvailableList = Gtk2::SimpleList->new(
"ESSID" => "text",
@@ -218,7 +218,7 @@ gtkadd(gtkset_border_width($w->{window}, 2),
my ($mode, $channel, $key);
my $essid = $AvailableList->{data}["@selected"][0];
my $dhcp = 1; # assume dhcp for new networks
- &AddNet($essid, $mode, $channel, $key, $dhcp);
+ &AddNet($essid, $mode, $channel, $dhcp, $key);
}),
gtksignal_connect(Gtk2::Button->new("Rescan"), clicked => sub { &UpdateAvailable })
)
@@ -304,9 +304,9 @@ sub UpdateAvailable() {
}
sub AddNet {
- my ($essid, $mode, $channel, $key, $dhcp) = @_;
+ my ($essid, $mode, $channel, $dhcp, $key) = @_;
print "Adding net $essid\n";
- push @{$KnownList->{data}}, [ $essid, $mode, $channel, $key, $dhcp ];
+ push @{$KnownList->{data}}, [ $essid, $mode, $channel, $dhcp, $key ];
$_->{add_net}($_->{config_location}, $essid) foreach values %available_roaming_daemons;
}
@@ -357,11 +357,11 @@ sub ConnectNow {
if ($KnownList->{data}[$row][2]) {
push @command, "channel $KnownList->{data}[$row][2] ";
}
- if ($KnownList->{data}[$row][3]) {
- push @command, "key $KnownList->{data}[$row][3] ";
+ if ($KnownList->{data}[$row][4]) {
+ push @command, "key $KnownList->{data}[$row][4] ";
}
push @command, "; ";
- if ($KnownList->{data}[$row][4]) {
+ if ($KnownList->{data}[$row][3]) {
push @command, "$IFConfig $device up; $DHClient $device";
}
else {