jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [trunk/] [modules/] [apcusv/] [setup.pl] - Blame information for rev 10

 

Line No. Rev Author Line
110simandl#!/usr/bin/env perl
2 
3use warnings;
4use diagnostics;
5 
6use lib "../../lib";
7use HotSaNICparser;
8use HotSaNICshellio;
9 
10my @CONFmod=HotSaNICparser::read_settings(".",$MODNAME);
11 
12if ( ! -e "settings" ) { $OUTFILE="settings"; } else { $OUTFILE="settings.new"; }
13 
14open OUTFILE,">$OUTFILE" || die "could not open $MODNAME settings file for writing.\n";
15 
16print OUTFILE "# SHORT DESCRIPTION
17#
18# define path to the apc access tool including the cmdline option
19# to retrieve the status protocol
20#
21# Example:
22# APCACCESS=/usr/local/bin/apcaccess status
23#
24";
25 
26if ($OUTFILE eq "settings.new") {
27 for (@CONFmod) { print OUTFILE $_,"\n" if /^APCACCESS *=/; }
28 }
29else {
30 my @found=HotSaNICparser::locate_files("apcaccess");
31 my $file=HotSaNICshellio::choose("","apcaccess could not be found.",@found);
32 print OUTFILE "APCACCESS=$file\n"
33 }
34 
35close OUTFILE;
36 
37if ($OUTFILE eq "settings.new") {
38 HotSaNICparser::backup_file("settings");
39 rename "settings.new","settings";
40 }
41 
42print "Please check the settings file and adapt it to satisfy your needs.\n";
43 

Powered by WebSVN 2.2.1