]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: debian postinst / do not fail on user creation if it already exists 8674/head
authorAntoine Joubert <antoine.joubert@nameshield.net>
Mon, 16 Dec 2019 16:57:13 +0000 (17:57 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 7 Jan 2020 11:32:12 +0000 (12:32 +0100)
(cherry picked from commit fddad2718fb994d4fd016c03e1e05ef6c67aae14)

builder-support/debian/recursor/debian-buster/pdns-recursor.postinst
builder-support/debian/recursor/debian-jessie/pdns-recursor.postinst
builder-support/debian/recursor/debian-stretch/pdns-recursor.postinst

index 1c32de2854bba1bfbc3e1e3cbafa1647e8cf83d5..ae925a6cf070d723212a95062751410be19dd24b 100644 (file)
@@ -3,8 +3,12 @@ set -e
 
 case "$1" in
   configure)
-    addgroup --system pdns
-    adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns
+    if [ -z "`getent group pdns`" ]; then
+      addgroup --system pdns
+    fi
+    if [ -z "`getent passwd pdns`" ]; then
+      adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns
+    fi
   ;;
 
   *)
index 1c32de2854bba1bfbc3e1e3cbafa1647e8cf83d5..ae925a6cf070d723212a95062751410be19dd24b 100644 (file)
@@ -3,8 +3,12 @@ set -e
 
 case "$1" in
   configure)
-    addgroup --system pdns
-    adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns
+    if [ -z "`getent group pdns`" ]; then
+      addgroup --system pdns
+    fi
+    if [ -z "`getent passwd pdns`" ]; then
+      adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns
+    fi
   ;;
 
   *)
index 1c32de2854bba1bfbc3e1e3cbafa1647e8cf83d5..ae925a6cf070d723212a95062751410be19dd24b 100644 (file)
@@ -3,8 +3,12 @@ set -e
 
 case "$1" in
   configure)
-    addgroup --system pdns
-    adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns
+    if [ -z "`getent group pdns`" ]; then
+      addgroup --system pdns
+    fi
+    if [ -z "`getent passwd pdns`" ]; then
+      adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns
+    fi
   ;;
 
   *)