hotsanic |
Subversion Repositories: |
Compare with Previous - Blame - Download
#!/usr/bin/env perl
# $Id: setup.pl,v 1.8 2004/07/12 07:50:15 bernisys Exp $
# include PERL libraries
use strict;
use warnings;
use diagnostics;
# include HotSaNIC libraries
use lib "../../lib";
use lib "./platform";
use HotSaNICparser;
use HotSaNIClog;
use common;
$|=1;
(my $VERSION = '$Revision: 1.8 $') =~ s/.*(\d+\.\d+).*/$1/;
(my $IDENTIFIER = '$Id: setup.pl,v 1.8 2004/07/12 07:50:15 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{STREAM}}) { $MODCONF{STREAM}="STREAM=\"".join("\"\nSTREAM=\"",@{$MODCONF{STREAM}})."\""; }
else { $MODCONF{STREAM}=""; }
print OUTFILE "# SHORT DESCRIPTION
#
# configure the http-retrieval method
# everything other than \"lynx\" will use the perl-module LWP::Simple,
# which is the default.
#
# METHOD=[lynx|.*]
#
# example:
# METHOD=lynx
#
METHOD=\"$MODCONF{METHOD}\"
# Configure some shoutcast streams you want to monitor:
# multiple lines are of course allowed.
#
# STREAM=<URL>,<description>,<bitrate>
#
# NOTE: <bitrate> will be in BITS/s not in KILObits/s !
# example:
# STREAM=http://some.host.org/stats.html,testhost,128000
#
$MODCONF{STREAM}
";
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";