From 64ee56f83848ce4404df52433814a6e51ff4faf5 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 20 Mar 2014 16:55:55 +0100 Subject: [PATCH] debian: same style for postinst and postrm Use a case switch in both files. Moreover, `#DEBHELPER#` may want to do something if we configure or reconfigure. Let it do that. --- debian/lldpd.postinst | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/debian/lldpd.postinst b/debian/lldpd.postinst index 5a854e12..79c1b799 100644 --- a/debian/lldpd.postinst +++ b/debian/lldpd.postinst @@ -2,18 +2,20 @@ set -e -if ! ([ "$1" = "configure" ] || [ "$1" = "reconfigure" ]); then - exit 0 -fi +case "$1" in + configure|reconfigure) + ;; + *) + adduser --system --disabled-password --disabled-login --home /var/run/lldpd \ + --no-create-home --quiet --force-badname --group _lldpd -adduser --system --disabled-password --disabled-login --home /var/run/lldpd \ - --no-create-home --quiet --force-badname --group _lldpd - -for i in /usr/sbin/lldpcli; do - if ! dpkg-statoverride --list $i > /dev/null 2>&1; then - dpkg-statoverride --update --add _lldpd adm 4750 $i - fi -done + for i in /usr/sbin/lldpcli; do + if ! dpkg-statoverride --list $i > /dev/null 2>&1; then + dpkg-statoverride --update --add _lldpd adm 4750 $i + fi + done + ;; +esac #DEBHELPER# -- 2.39.5