| 1 | 1 | simandl | #!/usr/bin/env perl |
| 2 | | | |
| 3 | | | # $Id: setup.pl,v 1.9 2004/07/12 07:50:13 bernisys Exp $ |
| 4 | | | |
| 5 | | | # include PERL libraries |
| 6 | | | use strict; |
| 7 | | | use warnings; |
| 8 | | | use diagnostics; |
| 9 | | | |
| 10 | | | # include HotSaNIC libraries |
| 11 | | | use lib "../../lib"; |
| 12 | | | use lib "./platform"; |
| 13 | | | use HotSaNICparser; |
| 14 | | | use HotSaNICshellio; |
| 15 | | | use HotSaNIClog; |
| 16 | | | use common; |
| 17 | | | |
| 18 | | | $|=1; |
| 19 | | | |
| 20 | | | (my $VERSION = '$Revision: 1.9 $') =~ s/.*(\d+\.\d+).*/$1/; |
| 21 | | | (my $IDENTIFIER = '$Id: setup.pl,v 1.9 2004/07/12 07:50:13 bernisys Exp $') =~ s/.*,v (.*) \$/$1/; |
| 22 | | | |
| 23 | | | my $MODNAME=HotSaNICparser::get_module_name(); |
| 24 | | | my %MODCONF=HotSaNICmod::common::configure(); |
| 25 | | | my $OUTFILE="settings.new"; |
| 26 | | | if ( ! -e "settings" ) { $OUTFILE="settings"; } |
| 27 | | | open OUTFILE,">$OUTFILE" || die "could not open ".HotSaNICparser::get_module_name()." settings file for writing.\n"; |
| 28 | | | |
| 29 | | | if ($MODCONF{BINDPATH} eq "") { |
| 30 | | | my @found=HotSaNICparser::locate_files("bin/rndc"); |
| 31 | | | $MODCONF{BINDPATH}=HotSaNICshellio::choose("","\"rndc\" could not be found.",@found); |
| 32 | | | } |
| 33 | | | |
| 34 | | | print OUTFILE "# SHORT DESCRIPTION |
| 35 | | | # |
| 36 | | | # You need to enter the path to your (r)ndc binary and |
| 37 | | | # the filename which BIND logs statistics to. |
| 38 | | | # |
| 39 | | | # Extra BIND configuration should not be necessary, however |
| 40 | | | # BIND should NOT be automatically generating statistics |
| 41 | | | # (use the 'statisticsinterval 0' option in named.conf) since |
| 42 | | | # this module will be doing it anyhow. |
| 43 | | | # |
| 44 | | | # Example: |
| 45 | | | # BINDPATH=/usr/local/bin/rndc |
| 46 | | | # BINDSTAT=/var/named/named.stats |
| 47 | | | # |
| 48 | | | BINDPATH=$MODCONF{BINDPATH} |
| 49 | | | BINDSTAT=$MODCONF{BINDSTAT} |
| 50 | | | "; |
| 51 | | | |
| 52 | | | close OUTFILE; |
| 53 | | | |
| 54 | | | if ($OUTFILE eq "settings.new") { |
| 55 | | | HotSaNICparser::backup_file("settings"); |
| 56 | | | rename "settings.new","settings"; |
| 57 | | | } |
| 58 | | | |
| 59 | | | print "Please check the settings file and adapt it to satisfy your needs.\n"; |
| 60 | | | |