doc/fr/internal/homepage.pl
Stephane Legrand c77df05206 New translations.
fr/internal/about.sgml: MFen 1.33
  fr/internal/bylaws.sgml: MFen 1.3
  fr/internal/core-vote.sgml: MFen 1.1
  fr/internal/developer.sgml: MFen 1.18
  fr/internal/expire-bits.sgml: MFen 1.1
  fr/internal/homepage.sgml: MFen 1.4
  fr/internal/internal.sgml: MFen 1.11
  fr/internal/machines.sgml: MFen 1.21
  fr/internal/mirror.sgml: MFen 1.13
  fr/internal/new-account.sgml: MFen 1.2
  fr/internal/photos.sgml: MFen 1.9
  fr/internal/releng.sgml: MFen 1.7
  fr/internal/statistic.sgml: MFen 1.9

  fr/internal/homepage.pl: no original rev. number
                           no translation (this is a simple script)
2003-09-14 09:49:13 +00:00

50 lines
1 KiB
Perl

#!/usr/bin/perl
$passwd = '/etc/passwd';
$homepagedir = 'public_html';
@index = ('index.html', 'index.cgi');
$noindex = '.noindex';
open(P, 'ypcat passwd |') || die "open $passwd: $!\n";
undef @pages;
while(<P>) {
($login,$passwd,$uid,$gid,$gcos,$home,$shell) = split(/:/);
# cleanup gecos
$gcos =~ s/,.*//;
# disable daemons
next if $uid <= 100;
next if $login eq 'nobody';
next if $shell =~ ~ m%/(pppd|sliplogin|nologin|nonexistent)$%;
# uucp accounts
next if $login =~ /^U/;
$p = $home . '/' . $homepagedir;
# user don't want be on the index
next if -f "$p/$noindex";
foreach (@index) {
if (-f "$p/$_" && -r "$p/$_") {
if ($_ !~ /\.cgi$/ || -x "$p/$_") {
push(@pages, $gcos . ':' . $login);
last;
}
}
}
}
close P;
if ($#pages < 0) {
die "No users found!\n";
}
foreach (sort @pages) {
($gcos, $login) = split(/:/);
($firstgecos, @gecos) = split(/,/, $gcos);
print qq{<LI><A HREF="http://people.FreeBSD.org/~$login/">},
$firstgecos, "</A> ", join(', ', @gecos), "</LI>\n";
}