diff options
author | Hugo Osvaldo Barrera | 2016-04-16 15:03:17 -0300 |
---|---|---|
committer | Hugo Osvaldo Barrera | 2016-04-16 15:03:17 -0300 |
commit | 2e925c56191bef29d92236b5ce14feae2933a25b (patch) | |
tree | b8f64104133f1bd1d8aea3701d56d384799b844b | |
parent | cb392994e8896d30164b8d3e2f95aa144a362cfb (diff) | |
download | aur-2e925c56191bef29d92236b5ce14feae2933a25b.tar.gz |
Fix user creation in the install script
-rw-r--r-- | PKGBUILD | 1 | ||||
-rw-r--r-- | opensmtpd-snapshot.install | 14 |
2 files changed, 8 insertions, 7 deletions
@@ -1,4 +1,5 @@ # Maintainer: Hugo Osvaldo Barrera <hugo@barrera.io> +# Contributor: nougad pkgname=opensmtpd-snapshot _pkgname=opensmtpd diff --git a/opensmtpd-snapshot.install b/opensmtpd-snapshot.install index d9cff8a5e147..07d0dd316f11 100644 --- a/opensmtpd-snapshot.install +++ b/opensmtpd-snapshot.install @@ -1,18 +1,18 @@ post_install() { - if [ $(getent group _smtpd > /dev/null) ]; then + if ! getent group _smtpd > /dev/null; then groupadd -r _smtpd fi; - if [ $(getent group _smtpq > /dev/null) ]; then + if ! getent group _smtpq > /dev/null; then groupadd -r _smtpq fi; - if [ $(getent passwd _smtpd > /dev/null) ]; then + if ! getent passwd _smtpd > /dev/null; then useradd -c "SMTPD Daemon" -r -g _smtpd -d /var/empty -s /sbin/nologin _smtpd fi; - if [ $(getent passwd _smtpq > /dev/null) ]; then - useradd "SMTPD queue user" -r -g _smtpd -d /var/empty -s /sbin/nologin _smtpq + if ! getent passwd _smtpq > /dev/null; then + useradd -c "SMTPD queue user" -r -g _smtpd -d /var/empty -s /sbin/nologin _smtpq fi; - if [ $(getent passwd _smtpf > /dev/null) ]; then - useradd "SMTPD filter user" -r -g _smtpd -d /var/empty -s /sbin/nologin _smtpq + if ! getent passwd _smtpf > /dev/null; then + useradd -c "SMTPD filter user" -r -g _smtpd -d /var/empty -s /sbin/nologin _smtpf fi; chown -R _smtpd:_smtpd /etc/mail |