jablonka.czprosek.czf

hotsanic

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

Compare with Previous - Blame - Download


#!/usr/bin/env perl

# $Id: setup.pl,v 1.10 2004/07/12 07:50:13 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.10 $') =~ s/.*(\d+\.\d+).*/$1/;
(my $IDENTIFIER = '$Id: setup.pl,v 1.10 2004/07/12 07:50:13 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{APCACCESS} eq "") {
  my @found=HotSaNICparser::locate_files("apcaccess");
  $MODCONF{APCACCESS}=HotSaNICshellio::choose("","apcaccess could not be found.",@found);
  }

print OUTFILE "# SHORT DESCRIPTION
#
# define path to the apc access tool including the cmdline option
# to retrieve the status protocol
#
# Example:
#   APCACCESS=/usr/local/bin/apcaccess status
#
APCACCESS=\"$MODCONF{APCACCESS}\"
";

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