diff options
author | Ying-Chieh Liao <ijliao@FreeBSD.org> | 2002-06-17 19:28:21 +0000 |
---|---|---|
committer | Ying-Chieh Liao <ijliao@FreeBSD.org> | 2002-06-17 19:28:21 +0000 |
commit | 3fe92c064405eaf92ebe67ab8b99638b37976ab0 (patch) | |
tree | ce42580cf21cdc4ff44e64d54a4bce40fb092876 /security/amavis-perl/pkg-install.postfix | |
parent | 717b616e93e7555d4a106c9390bf436550a66422 (diff) |
Notes
Diffstat (limited to 'security/amavis-perl/pkg-install.postfix')
-rw-r--r-- | security/amavis-perl/pkg-install.postfix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/security/amavis-perl/pkg-install.postfix b/security/amavis-perl/pkg-install.postfix new file mode 100644 index 000000000000..ec1f8247c75e --- /dev/null +++ b/security/amavis-perl/pkg-install.postfix @@ -0,0 +1,31 @@ +#!/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; +}; |