summaryrefslogtreecommitdiffstats
path: root/dhcp_wizard
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-10-17 16:54:52 +0000
committerThierry Vignaud <tv@mageia.org>2012-10-17 16:54:52 +0000
commit591f339e3a342e1f53ba073af903f45720a5af09 (patch)
treee420e12519421092c9ef6ff3fbed753aee41be67 /dhcp_wizard
parenta56d789ba6ce63ab379f525ad822e527924c3aed (diff)
downloaddrakwizard-591f339e3a342e1f53ba073af903f45720a5af09.tar
drakwizard-591f339e3a342e1f53ba073af903f45720a5af09.tar.gz
drakwizard-591f339e3a342e1f53ba073af903f45720a5af09.tar.bz2
drakwizard-591f339e3a342e1f53ba073af903f45720a5af09.tar.xz
drakwizard-591f339e3a342e1f53ba073af903f45720a5af09.zip
do not reinvent cat_or_die()
Diffstat (limited to 'dhcp_wizard')
-rwxr-xr-xdhcp_wizard/Dhcp.pm5
1 files changed, 1 insertions, 4 deletions
diff --git a/dhcp_wizard/Dhcp.pm b/dhcp_wizard/Dhcp.pm
index 2fe1195f..23fd555f 100755
--- a/dhcp_wizard/Dhcp.pm
+++ b/dhcp_wizard/Dhcp.pm
@@ -212,9 +212,7 @@ sub do_it {
if (!`grep INTERFACES $file`) {
my $tmp = `/bin/mktemp /tmp/Dhcpconf.XXXXXX` or die "can't make a temp file: $!";
open(my $NEW, "> $tmp") or die "can't open $tmp: $!";
- open(my $OLD, "< $file") or die "can't open default: $!";
- local $_;
- while (<$OLD>) {
+ foreach (cat_or_die($file)) {
if (m|INTERFACE|) {
print $NEW "# $_";
}
@@ -222,7 +220,6 @@ sub do_it {
print $NEW $_;
}
MDK::Common::append_to_file($tmp, "\n# Added by drakwizard\nINTERFACES=$wiz_device");
- close($OLD);
close($NEW);
chomp($tmp);
system("mv $tmp $file");