From 8bd4ab3334a006a0203d4df4822a81ad05383ee4 Mon Sep 17 00:00:00 2001 From: libvoid <135131094+libvoid@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:14:38 +0200 Subject: [PATCH] build: fix `postremove` script bug deleting logrotate conf on upgrade --- packaging/postremove.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packaging/postremove.sh b/packaging/postremove.sh index 666a2680..a65f85b8 100755 --- a/packaging/postremove.sh +++ b/packaging/postremove.sh @@ -1,6 +1,8 @@ #!/bin/sh -e # shellcheck source=/dev/null +[ "$1" != "remove" ] && exit 0 # run this script only on install + if grep -q "debian" /etc/os-release; then . /usr/share/debconf/confmodule db_purge @@ -17,4 +19,3 @@ rm -f /etc/logrotate.d/sshportal || true grep -q sshportal /etc/passwd && userdel sshportal systemctl daemon-reload systemctl reset-failed -