summaryrefslogtreecommitdiffstats
path: root/client_wizard
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-10-17 17:09:16 +0000
committerThierry Vignaud <tv@mageia.org>2012-10-17 17:09:16 +0000
commitd816169de90a86176981cb9cc4a6eb09097413a3 (patch)
treef1108f86fa8d9dfdc5b836a128467de1a5b5fc73 /client_wizard
parent27a8e524914e6837b6088c2d29e6a0d186d17ce3 (diff)
downloaddrakwizard-d816169de90a86176981cb9cc4a6eb09097413a3.tar
drakwizard-d816169de90a86176981cb9cc4a6eb09097413a3.tar.gz
drakwizard-d816169de90a86176981cb9cc4a6eb09097413a3.tar.bz2
drakwizard-d816169de90a86176981cb9cc4a6eb09097413a3.tar.xz
drakwizard-d816169de90a86176981cb9cc4a6eb09097413a3.zip
(do_it) do not reinvent append_to_file()
Diffstat (limited to 'client_wizard')
-rwxr-xr-xclient_wizard/Bind_client.pm9
1 files changed, 2 insertions, 7 deletions
diff --git a/client_wizard/Bind_client.pm b/client_wizard/Bind_client.pm
index fc3ddc2a..4aa612f0 100755
--- a/client_wizard/Bind_client.pm
+++ b/client_wizard/Bind_client.pm
@@ -164,17 +164,12 @@ sub do_it {
my $client_name = $o->{var}{client_name};
$client_name =~ s/\.$wiz_domain_name$//;
MDK::Common::cp_af($file, $file . ".orig");
- local *NEW;
- open(NEW, ">> $file") or die "can not open $file";
- print NEW "\n$client_name IN A $o->{var}{client_ip} ; $date\n\n";
- close(NEW) or die "can not close $file";
+ append_to_file($file, "\n$client_name IN A $o->{var}{client_ip} ; $date\n\n");
up_serial($file);
$file="/var/named/$s_trunc.rev";
MDK::Common::cp_af($file, $file . ".orig");
- open(NEW, ">> $file") or die "can not open $file";
- print NEW "\n$dc IN PTR $o->{var}{client_name}. ; $date\n\n";
- close(NEW) or die "can not close $file";
+ append_to_file($file, "\n$dc IN PTR $o->{var}{client_name}. ; $date\n\n");
up_serial($file);
if (services::is_service_running('named')) {
services::restart('named');