version 1.6, 2010/12/14 20:32:49
|
version 1.7, 2010/12/16 14:24:25
|
Line 13 BEGIN {
|
Line 13 BEGIN {
|
delete @ENV{qw(IFS CDPATH ENV BASH_ENV PATH)}; |
delete @ENV{qw(IFS CDPATH ENV BASH_ENV PATH)}; |
$ENV{PATH} = "/bin:/usr/bin"; |
$ENV{PATH} = "/bin:/usr/bin"; |
$|++; |
$|++; |
$SIG{__DIE__} = sub { require Carp; Carp::confess(@_); } |
# $SIG{__DIE__} = sub { require Carp; Carp::confess(@_); } |
} |
} |
|
|
use strict; |
use strict; |
Line 36 my %cfg = &fetchConfig( );
|
Line 36 my %cfg = &fetchConfig( );
|
my $EOL = "\015\012"; |
my $EOL = "\015\012"; |
|
|
## |
## |
## These will be moved in to a config file |
## These are read in from the config file |
## |
## |
my $BBS_NODE = 0; |
my $BBS_NODE = 0; |
my $pidFile = $cfg{'pidfile'} || "/tmp/telnetbbs.pid"; |
my $pidFile = $cfg{'pidfile'} || "/tmp/telnetbbs.pid"; |
Line 165 sub startNetServer
|
Line 165 sub startNetServer
|
my $lock_file = ""; |
my $lock_file = ""; |
foreach (1 .. $MAX_NODE) |
foreach (1 .. $MAX_NODE) |
{ |
{ |
print "Searching for lock: " . $LOCK_PATH."/".$BBS_NAME."_node".$_.".lock\n"; |
|
next if ( -f $LOCK_PATH."/".$BBS_NAME."_node".$_.".lock" ); |
next if ( -f $LOCK_PATH."/".$BBS_NAME."_node".$_.".lock" ); |
|
|
## |
## |
Line 176 print "Searching for lock: " . $LOCK_PAT
|
Line 175 print "Searching for lock: " . $LOCK_PAT
|
close( LOCK ); |
close( LOCK ); |
$node = $BBS_NODE = $_; |
$node = $BBS_NODE = $_; |
} |
} |
print "Using lock: " . $LOCK_PATH."/".$BBS_NAME."_node".$node.".lock\n"; |
|
|
|
## |
## |
## Create our dosbox config |
## Create our dosbox config |
Line 318 sub shutdown
|
Line 316 sub shutdown
|
unlink( $pidFile ); |
unlink( $pidFile ); |
|
|
## |
## |
|
## Remove node lock files |
|
## |
|
foreach (1 .. $MAX_NODE) |
|
{ |
|
my $node_lock = $LOCK_PATH."/".$BBS_NAME."_node".$_.".lock"; |
|
unlink( $node_lock ) if ( -f $node_lock ); |
|
} |
|
|
|
## |
## Wait for the thread to shutdown |
## Wait for the thread to shutdown |
## |
## |
# $netThread->detach( ); |
# $netThread->detach( ); |
Line 460 sub findConfig
|
Line 467 sub findConfig
|
my $cf = 0; |
my $cf = 0; |
my @paths = qw| ./ ./.telnetbbs /etc /usr/local/etc |; |
my @paths = qw| ./ ./.telnetbbs /etc /usr/local/etc |; |
|
|
|
return $opts{'config'} if defined $opts{'config'}; |
|
|
foreach ( @paths ) |
foreach ( @paths ) |
{ |
{ |
my $fn = $_ . "/telnetbbs.conf"; |
my $fn = $_ . "/telnetbbs.conf"; |
Line 480 sub fetchOptions {
|
Line 489 sub fetchOptions {
|
my %opts; |
my %opts; |
|
|
&GetOptions( |
&GetOptions( |
|
"config:s" => \$opts{'config'}, |
"help|?" => \$opts{'help'}, |
"help|?" => \$opts{'help'}, |
"man" => \$opts{'man'}, |
"man" => \$opts{'man'}, |
"port:i" => \$opts{'port'}, |
"port:i" => \$opts{'port'}, |
Line 502 telnetbbs.pl - A telnet server designed
|
Line 512 telnetbbs.pl - A telnet server designed
|
telnetbbs.pl [options] |
telnetbbs.pl [options] |
|
|
Options: |
Options: |
|
--config,c Specify the configuration file to use |
--help,? Display the basic help menu |
--help,? Display the basic help menu |
--man,m Display the detailed man page |
--man,m Display the detailed man page |
--port,p Port to listen on, default 23. |
--port,p Port to listen on, default 23. |
|
--verbose,v Enable verbose output |
|
|
=head1 DESCRIPTION |
=head1 DESCRIPTION |
|
|