summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Osvaldo Barrera2016-04-16 15:03:17 -0300
committerHugo Osvaldo Barrera2016-04-16 15:03:17 -0300
commit2e925c56191bef29d92236b5ce14feae2933a25b (patch)
treeb8f64104133f1bd1d8aea3701d56d384799b844b
parentcb392994e8896d30164b8d3e2f95aa144a362cfb (diff)
downloadaur-2e925c56191bef29d92236b5ce14feae2933a25b.tar.gz
Fix user creation in the install script
-rw-r--r--PKGBUILD1
-rw-r--r--opensmtpd-snapshot.install14
2 files changed, 8 insertions, 7 deletions
diff --git a/PKGBUILD b/PKGBUILD
index d5f70c0dc286..e635de09a9a3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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