File: slrn_getdescs

package info (click to toggle)
slrn 1.0.3%2Bdfsg-5
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 6,396 kB
  • sloc: ansic: 39,852; sh: 3,777; perl: 467; makefile: 229; sed: 16
file content (27 lines) | stat: -rw-r--r-- 791 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl
#
# Update newsgroup descriptions file.
# This should be run by root.

# Make sure TERM is set to something sane, or slrn will get upset.
$ENV{TERM}='vt100';

# Make sure the umask is sane as well.
umask(022);

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

# The global slrn.rc file; used instead of root's .slrnrc.
$global_rc_file="/etc/news/slrn.rc";

# If the file is younger than 7 days old, do not update it.
$min_age=shift || 7;
$min_age--; # small fudge factor

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 "su news -s /bin/sh -c 'slrn -i $global_rc_file -f $dsc_file_slrn -h \$(cat /etc/news/server) -d'";
	chmod 0644,$dsc_file;
}