Skip to content
Snippets Groups Projects
Commit 874f319f authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

presunuta funkce loadConf; uprava hlavicky souboru + zmena datumu; zmena...

presunuta funkce loadConf; uprava hlavicky souboru + zmena datumu; zmena nastaveni Sys::Syslog modulu; uprava formatovani
parent e1350344
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/perl -w
#
# WardenClientCommon.pm
#
# Copyright (C) 2011-2013 Cesnet z.s.p.o
# Copyright (C) 2011-2015 Cesnet z.s.p.o
#
# Use of this source is governed by a BSD-style license, see LICENSE file.
package WardenClientCommon;
use strict;
use Carp;
use warnings;
use SOAP::Lite;
use IO::Socket::SSL qw(debug1);
use SOAP::Transport::HTTP;
use Sys::Syslog;
use Sys::Syslog qw(:DEFAULT setlogsock);
Sys::Syslog::setlogsock('unix');
use Carp;
our $VERSION = "2.2";
......@@ -22,7 +23,7 @@ our $VERSION = "2.2";
#-------------------------------------------------------------------------------
sub errMsg
{
my $msg = shift;
my $msg = shift;
my $type = shift;
defined $type or $type = "err"; # default type is err. Other: warn
......@@ -172,4 +173,29 @@ sub getClientsInfo
return @clients;
}
#-------------------------------------------------------------------------------
# loadConf - load configuration file
#-------------------------------------------------------------------------------
sub loadConf
{
my $conf_file = shift;
our $BASEDIR = undef;
our $URI = undef;
our $SSL_KEY = undef;
our $SSL_CERT = undef;
our $SSL_CA_CERT = undef;
our $MAX_RCV_EVENTS_LIMIT = undef;
our $CONNECTION_TIMEOUT = undef;
our $LOG_STDERR = undef;
our $SYSLOG = undef;
our $SYSLOG_VERBOSE = undef;
our $SYSLOG_FACILITY = undef;
unless (do $conf_file) {
die("Errors in config file '$conf_file': $@") if $@;
die("Can't read config file '$conf_file': $!") unless defined $_;
# if $_ defined, it's retvalue of last statement of conf, for which we don't care
}
} # End of loadConf
1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment