diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-10-17 17:09:16 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-10-17 17:09:16 +0000 |
commit | d816169de90a86176981cb9cc4a6eb09097413a3 (patch) | |
tree | f1108f86fa8d9dfdc5b836a128467de1a5b5fc73 | |
parent | 27a8e524914e6837b6088c2d29e6a0d186d17ce3 (diff) | |
download | drakwizard-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()
-rwxr-xr-x | client_wizard/Bind_client.pm | 9 |
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'); |