#!/usr/bin/perl

use strict;
use warnings;
use Getopt::Long qw(:config no_ignore_case);
use Perun::Agent;
use Perun::Common qw(printMessage);

sub help {
	return qq{
	Loads external sources definitions from perun's 
	configuration file and updates entries stored in the DB. 
	Tool can be used only by PERUNADMIN.
	------------------------------------
	Available options:
	--help        | -h prints this help

	};
}

GetOptions ("help|h" => sub {
		print help();
		exit 0;
	}) || die help();

my $agent = Perun::Agent->new();
my $extSourcesAgent = $agent->getExtSourcesAgent;

$extSourcesAgent->loadExtSourcesDefinitions();

print "External sources definitions have been successfully loaded\n";
