diff options
author | ache <ache@FreeBSD.org> | 2001-10-17 21:53:03 +0800 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-10-17 21:53:03 +0800 |
commit | 1238343b7de7ba0e702cd4ae6b4eb8bc68c8f6b9 (patch) | |
tree | bc2242f084ecf3a236638e824c7350971643e619 /security/drweb-sendmail | |
parent | 7be13efa126cd185dff032b905282586c07e0b07 (diff) | |
download | freebsd-ports-gnome-1238343b7de7ba0e702cd4ae6b4eb8bc68c8f6b9.tar.gz freebsd-ports-gnome-1238343b7de7ba0e702cd4ae6b4eb8bc68c8f6b9.tar.zst freebsd-ports-gnome-1238343b7de7ba0e702cd4ae6b4eb8bc68c8f6b9.zip |
Add drweb:drweb automatically
Diffstat (limited to 'security/drweb-sendmail')
-rw-r--r-- | security/drweb-sendmail/scripts/post-install | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/security/drweb-sendmail/scripts/post-install b/security/drweb-sendmail/scripts/post-install index 7e0a5a7d02db..5d88802e161c 100644 --- a/security/drweb-sendmail/scripts/post-install +++ b/security/drweb-sendmail/scripts/post-install @@ -1,21 +1,29 @@ #!/bin/sh ex=0 -if ! id -u drweb > /dev/null 2>&1; then - echo "You need an account \"drweb\" to install this package." - echo "Please add it by hand (try \"man vipw\") and try again." - echo "" - echo "An example /etc/master.passwd entry is:" - echo "drweb:*:426:426::0:0:Dr.Web Scanner:/nonexistent:/sbin/nologin" - echo "" - ex=1 +USER=drweb +GROUP=${USER} +UID=426 +GID=${UID} + +if ! pw group show "${GROUP}" 2>/dev/null 1>&2; then + if pw groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + ex=1 + fi fi -if ! grep -q "^drweb:" /etc/group; then - echo "You need a group \"drweb\" to install this package." - echo "" - echo "An example /etc/group entry is:" - echo "drweb:*:426:" - echo "" - ex=1 + +if ! pw user show "${USER}" 2>/dev/null 1>&2; then + if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -s "/sbin/nologin" -d "/nonexistent" -c "Dr. Web Scanner" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + ex=1 + fi fi + [ "$ex" = "1" ] && exit 1 exit 0 |