makedeb


traefik 2.7.0-2


Modern reverse proxy written in Go

Click here to go back to the commit logs for traefik.

Commit:


Hash: a2849ae317af769e1d33136b16a86a6b5ce6ccad

Message: Fix install scripts

Diff


diff --git a/.SRCINFO b/.SRCINFO
index 4f9eae7..04c1317 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -2,7 +2,7 @@ generated-by = makedeb
 pkgname = traefik
 pkgbase = traefik
 pkgdesc = Modern reverse proxy written in Go
-pkgrel = 1
+pkgrel = 2
 pkgver = 2.7.0
 url = https://github.com/traefik/traefik
 arch = any
diff --git a/PKGBUILD b/PKGBUILD
index e6dcfa8..5d2608b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@ _repo=traefik/traefik
 
 pkgname=traefik
 pkgver=2.7.0
-pkgrel=1
+pkgrel=2
 pkgdesc="Modern reverse proxy written in Go"
 arch=('any')
 url="https://github.com/${_repo}"
@@ -64,10 +64,12 @@ package() {
 
   # Add install scripts
   postinst="src/postinst"
-  echo "useradd -r -c 'traefik daemon' -M -d / -s /usr/sbin/nologin traefik" > "${srcdir}/postinst"
+  echo 'id traefik >/dev/null 2>/dev/null || useradd -r -c "traefik daemon" -M -d / -s /usr/sbin/nologin traefik' > "${srcdir}/postinst"
   echo "chown traefik:traefik /var/log/traefik" >> "${srcdir}/postinst"
   prerm="src/prerm"
-  echo "systemctl disable --now traefik" > "${srcdir}/prerm"
+  echo '[ "$1" = "upgrade" ] && exit 0' > "${srcdir}/prerm"
+  echo "systemctl disable --now traefik" >> "${srcdir}/prerm"
   postrm="src/postrm"
-  echo "userdel traefik" > "${srcdir}/postrm"
+  echo '[ "$1" = "upgrade" ] && exit 0' > "${srcdir}/postrm"
+  echo "userdel traefik" >> "${srcdir}/postrm"
 }