r4388 - trunk/Docs/server/rcon2irc

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Sep 6 16:05:51 EDT 2008


Author: div0
Date: 2008-09-06 16:05:50 -0400 (Sat, 06 Sep 2008)
New Revision: 4388

Modified:
   trunk/Docs/server/rcon2irc/rbiserver.pl
Log:
fix demo protecting


Modified: trunk/Docs/server/rcon2irc/rbiserver.pl
===================================================================
--- trunk/Docs/server/rcon2irc/rbiserver.pl	2008-09-06 20:03:04 UTC (rev 4387)
+++ trunk/Docs/server/rcon2irc/rbiserver.pl	2008-09-06 20:05:50 UTC (rev 4388)
@@ -92,8 +92,12 @@
 	my $pattern = "/nexuiz/data/home/.nexuiz/extramaps-$name/sv_autodemos/????-??-??_??-??_${map}_${slot}_${ip}-*.dem";
 	if(my @result = glob $pattern)
 	{
-		print "Cleaning up demos: protecting $result[0]\n";
-		chmod 0444, @result;
+		for(@result)
+		{
+			next if -M $_ > 1/24/60; # too old
+			print "Cleaning up demos: protecting $_\n";
+			chmod 0444, $_;
+		}
 	}
 	else
 	{
@@ -109,7 +113,7 @@
 	for(glob $pattern)
 	{
 		next if not -w $_;   # protected demo (by record, or other markers)
-		next if -M $_ > 0.1; # not old enough yet
+		next if -M $_ < 1/24/60; # not old enough yet
 		print "Cleaning up demos: deleting $_\n";
 		unlink $_;
 	}




More information about the nexuiz-commits mailing list