# ########################################################################## # hitcfg.pl # Required by HitMatic (hitmatic.cgi) # # REFER TO HITMATIC.CGI FOR INSTALLATION & CONFIGURATION # # (C) 1997 by Joe DePasquale, Last revised: March 12, 1997 # E-MAIL: getcruzn@shadow.net WEB: http://www.shadow.net/~getcruzn # ############################################################################ # # This script and accompanying files may be distributed freely # and modified, provided this header with my name, E-Mail address and # this notice remain intact. Ownership rights remain with me. You may # not sell this script without my approval. # # This script comes with no guarantee or warranty except for my good # intentions. By using this code you agree to indemnify me from any # liability that might arise from it's use. # # There is no technical support for this script, neither am I a # professional programmer. Please refer to 'HELPME.TXT' for general # guidance. I will try to answer questions by E-Mail as time allows. # ############################################################################ # Sub: Maintain hit.log, hitx.dat and hit.cfg sub checkCfg { &lock ($HITCFLK); open (CFG,"+<$HITCFG"); $cfgFile = ; ($logDay,$datMonth,$cntMonth,$eol) = split (/\|/,$cfgFile); # Make new log file if ($logDay != $dayStamp) { if (-s $HITLOG1) { print `cp $HITLOG1 $HITLOG2`; if (-s $HITLOG1 == -s $HITLOG2) { open (LOG,">$HITLOG1"); print LOG "$timeStamp\| Today's FILE MAINTENANCE DONE by our Guest Clobberer: $ENV{'REMOTE_HOST'}\|\n"; close (LOG); $logDay = $dayStamp; &chngCfg; } } } # Make new month file if ($datMonth+0 != $month) { open (DAT,">$HITDAT"); print (DAT ""); # clobber it close (DAT); $datMonth = $month; &chngCfg; } close (CFG); &unlock ($HITCFLK); } # end checkCfg ############################################################################ # Sub : Change hit.cfg sub chngCfg { $cfgFile = join ("\|",$logDay,$datMonth,$cntMonth,$eol); seek (CFG,0,0); print (CFG $cfgFile); } # end chngCfg ############################################################################ 1; # return true