jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [ntp/] [setup.pl] - Rev 23 Go to most recent revision

Compare with Previous - Blame - Download


#!/usr/bin/env perl

# $Id: setup.pl,v 1.4 2004/07/12 07:50:14 bernisys Exp $

# include PERL libraries
use strict;
use warnings;
use diagnostics;

# include HotSaNIC libraries
use lib "../../lib";
use lib "./platform";
use HotSaNICparser;
use HotSaNICshellio;
use HotSaNIClog;
use common;

$|=1;

(my $VERSION = '$Revision: 1.4 $') =~ s/.*(\d+\.\d+).*/$1/;
(my $IDENTIFIER = '$Id: setup.pl,v 1.4 2004/07/12 07:50:14 bernisys Exp $') =~ s/.*,v (.*) \$/$1/;

my $MODNAME=HotSaNICparser::get_module_name();
my %MODCONF=HotSaNICmod::common::configure();
my $OUTFILE="settings.new";
if ( ! -e "settings" ) { $OUTFILE="settings"; }
open OUTFILE,">$OUTFILE" || die "could not open ".HotSaNICparser::get_module_name()." settings file for writing.\n";

if (@{$MODCONF{HOST}}) { $MODCONF{HOST}="HOST=\"".join("\"\nHOST=\"",@{$MODCONF{HOST}})."\""; }

print OUTFILE "# SHORT DESCRIPTION
#
# ntpd-client command
#
NTPCOMMAND=\"$MODCONF{NTPCOMMAND}\"

#
# configure targets
#
#  HOST=<host or IP>,<description>
#
# if you want to query the local host, just add:   HOST=\",\"
#
$MODCONF{HOST}
";

close OUTFILE;

if ($OUTFILE eq "settings.new") {
  HotSaNICparser::backup_file("settings");
  rename "settings.new","settings";
  }

print "Please check the settings file and adapt it to satisfy your needs.\n";


Powered by WebSVN 2.2.1