1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-15 03:14:23 +00:00
freebsd-ports/security/amavis-perl/pkg-install.postfix
Ying-Chieh Liao 3fe92c0644 add support for postfix and exim
PR:		32471
Submitted by:	Martijn Lina <martijn@ietsvaags.xs4all.nl>, TAKEMURA Masahiro <mastake@msel.t.u-tokyo.ac.jp>
Tested by:	TERAMOTO Masahiro <teramoto@comm.eng.osaka-u.ac.jp>, "Julian C. Dunn" <jdunn@aquezada.com>
Approved by:	maintainer timeout (1 month since I mailed him)
2002-06-17 19:28:21 +00:00

32 lines
711 B
Perl

#!/usr/bin/perl
$user=vscan;
$group=nogroup;
if (`grep ^vscan: /etc/passwd` eq "") {
print "You need a user \"${user}\".\n";
if (yesno("Would you like me to create it", "y")) {
system ("/usr/sbin/pw useradd ${user} -g ${group} -h - -d /nonexistent -s /nonexistent -c \"AMaViS Virus Scanner\" || exit");
print "Done.\n";
} else {
print "Please create it, and try again.\n";
exit 1;
};
} else {
print "You already have a user \"${user}\", so I will use it.\n";
};
sub yesno() {
my ($mes, $def) = @_;
print "$mes [$def]? ";
$answer = <STDIN>;
chomp($answer);
if ($answer eq "") {
$answer = "y";
};
if ($answer=~/^y/i) {
return 1;
};
return 0;
};