# quit.pl  by borys <tpcarter@mtu.edu>
# signs off with a random quit-string.

# put all your cool logoff messages in ~/.quitrc
# one per line.

# Setup variables 
$add_ons.='+quit.pl' if ($add_ons !~ /\bquit.pl/);
srand(time);

# Read in the config
my $quitrc=$ENV{'HOME'}.'/.quitrc';
my @msgs=();
if(open(QUIT,$quitrc)) {
	@msgs=<QUIT>;
	close QUIT;
}

# Start of commands
sub cmd_quit {
	if($args) {
		&sl("QUIT :$args");
		&exit;
	}

	if(@msgs) {
		my $tmp=int rand $#msgs;
		&sl("QUIT :$msgs[$tmp]");
		&exit;
	}

	&sl("QUIT :using \cbsirc\cb version ${version}${add_ons}");
	&exit;
} &addcmd('quit');

&print("*\cbB\cb* \cbborys\cb's *\cvquit.pl\cv* for sirc loaded");
