#!/usr/bin/perl -w

use Deluge::Config;
use Deluge::Mcp;

# -------------------------------------------------------------------

package main;

&main();
exit(0);

# -------------------------------------------------------------------

sub usage
{
    my ($comment) = @_;

	print STDERR "USAGE: deluge {configuration file}\n";

	($comment) && (print STDERR "ERROR: $comment\n");

	exit (1);
}

# -------------------------------------------------------------------

sub main
{
	my ($mcp, $cfg);

	srand($$);
	
	($#ARGV == -1) && (&usage());
	($#ARGV > 0) && (&usage("Incorrect number of parameters"));

	$cfg = Deluge::Config->new(shift(@ARGV));
	$mcp = Deluge::Mcp->new($cfg, 0);

	print STDERR "No forking yet.\n";

	$mcp->prep_for_attack();
	$mcp->main_attack_loop();
	$mcp->shut_down();
}

