#!/usr/local/bin/perl

# Edit the above line to point to the perl command on your machine
# Edit these variables here for your MUD
 
$ConfigFile = "/mud/cfg/Nightmare";
$BannerFile = "/mud/Nightmare/news/ftpd";
$DirRealms = "/realms";
$DirUsers = "/secure/save/users";
$Timeout = 7200;

# Do not edit anything else below here

$ConfigFile = shift(@ARGS) if (@ARGS > 0);

open(CFG, $ConfigFile);
while(<CFG>) {
    $MudName = $1 if /name : ([^\n]*)/;
    $PortFTP = ($1 - 1) if /port number : ([^\n]*)/;
    $DirMudlib = $1 if /mudlib directory : ([^\n]*)/;
    $DirLog = $1 if /log directory : ([^\n]*)/;
    $DirBinary = $1 if /binary directory : ([^\n]*)/;
}
close(CFG);

$LogFile = "$DirMudlib$DirLog/ftpd";

$Command = "$DirBinary/ftpd -b$BannerFile -l$LogFile -m$DirMudlib -n$MudName -p$PortFTP -r$DirRealms -t$Timeout -u$DirUsers";

system "$Command";


