diff options
author | Olivier Blin <oblin@mandriva.org> | 2004-08-11 15:40:50 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2004-08-11 15:40:50 +0000 |
commit | d375cd72acbcf57dd99a50db11923ed1543f7df2 (patch) | |
tree | b42cf71e0c181bc48fc6cbe6b36f4b2a03b07071 /perl-install | |
parent | b6872479918dc3d2cb98f6774d79771187ef1ab6 (diff) | |
download | drakx-backup-do-not-use-d375cd72acbcf57dd99a50db11923ed1543f7df2.tar drakx-backup-do-not-use-d375cd72acbcf57dd99a50db11923ed1543f7df2.tar.gz drakx-backup-do-not-use-d375cd72acbcf57dd99a50db11923ed1543f7df2.tar.bz2 drakx-backup-do-not-use-d375cd72acbcf57dd99a50db11923ed1543f7df2.tar.xz drakx-backup-do-not-use-d375cd72acbcf57dd99a50db11923ed1543f7df2.zip |
rewrite write_config for wlandetect to use output()
Diffstat (limited to 'perl-install')
-rwxr-xr-x | perl-install/standalone/drakroam | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/perl-install/standalone/drakroam b/perl-install/standalone/drakroam index e46de2454..62fb08a4c 100755 --- a/perl-install/standalone/drakroam +++ b/perl-install/standalone/drakroam @@ -75,29 +75,21 @@ my %available_roaming_daemons = ( }, write_config => sub { my ($config) = @_; - open(my $CONFIG, "> $config") or die("Can't open configuration file\n"); - print $CONFIG "#wlandetect configuration file\n#format: essid<tab><tab>commands\n#use \@DEV\@ for device name\n"; + my @contents = ( + "#wlandetect configuration file\n", + "#format: essid<tab><tab>commands\n", + "#use \@DEV\@ for device name\n" + ); foreach my $row (@{$KnownList->{data}}) { # again, lame - print $CONFIG "$row->[0]\t\t$IWConfig essid $row->[0]"; - if ($row->[1]) { - print $CONFIG "mode $row->[1] "; - } - if ($row->[2]) { - print $CONFIG "channel $row->[2] "; - } - if ($row->[3]) { - print $CONFIG "key $row->[3] "; - } - print $CONFIG "; "; - if ($row->[4]) { - print $CONFIG "$IFConfig \@DEV\@ up; $DHClient \@DEV\@"; - } - else { - print $CONFIG "$IFUp \@DEV\@" - } - print $CONFIG "\n"; + my $essid = $row->[0]; + 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\@"; + push @contents, "$essid\t\t$iwc; $ifc\n"; } - close $CONFIG; + output($config, @contents); }, }, ); |