#!/usr/bin/perl
#
# Update newsgroup descriptions file.
# This should be run by root.

# Location of newsgroups dsc file.
$dsc_file="/var/lib/slrn/newsgroups.dsc";

# If the file is younger than 6 days old, do not update it.
$min_age=6;

# Where's slrn?
$slrn="/usr/bin/slrn";

if (! -f $dsc_file || -M $dsc_file >= $min_age) {
	$dsc_file_slrn=$dsc_file;
	$dsc_file_slrn=~s/\.dsc$//; # slrn doesn't want the extention.
	system "$slrn -f $dsc_file_slrn -d";	
	chmod 0644,$dsc_file;
}
