From 64650e65779ba2ff9baaf4e6da85555dfc2fa66b Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 8 Jul 2022 11:58:30 +0200 Subject: [PATCH] TT#182450 debian/ngcp-rtpengine-*.postinst: fix shellcheck issues Fix `SC2043 (warning): This loop will only ever run once. Bad quoting or missing glob/expansion?` Fix-up for git rev de8b3d59c185de3d8bf35904fac99fcf12be4ef3, AKA Change-Id If75b6c1b675c8abf0bb33ae58b41e036276f8640 Change-Id: I46f58da69a683ed2fa67c86f9928fbfc8372482f --- debian/ngcp-rtpengine-daemon.postinst | 11 +++++------ debian/ngcp-rtpengine-recording-daemon.postinst | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/debian/ngcp-rtpengine-daemon.postinst b/debian/ngcp-rtpengine-daemon.postinst index f7be6d0b0..00d8b51d2 100644 --- a/debian/ngcp-rtpengine-daemon.postinst +++ b/debian/ngcp-rtpengine-daemon.postinst @@ -37,12 +37,11 @@ if [ "$1" = configure ]; then --no-create-home --disabled-password \ --group --quiet rtpengine || true - for DIR in /var/spool/rtpengine; do - if ! dpkg-statoverride --list "$DIR" > /dev/null 2>&1; then - chown rtpengine:rtpengine "$DIR" - chmod 0770 "$DIR" - fi - done + rtpdir='/var/spool/rtpengine' + if ! dpkg-statoverride --list "$rtpdir" > /dev/null 2>&1; then + chown rtpengine:rtpengine "$rtpdir" + chmod 0770 "$rtpdir" + fi fi #DEBHELPER# diff --git a/debian/ngcp-rtpengine-recording-daemon.postinst b/debian/ngcp-rtpengine-recording-daemon.postinst index fe6c81571..a3c052e1c 100644 --- a/debian/ngcp-rtpengine-recording-daemon.postinst +++ b/debian/ngcp-rtpengine-recording-daemon.postinst @@ -3,12 +3,11 @@ set -e if [ "$1" = configure ]; then - for DIR in /var/lib/rtpengine-recording; do - if ! dpkg-statoverride --list "$DIR" > /dev/null 2>&1; then - chown rtpengine:rtpengine "$DIR" - chmod 0770 "$DIR" - fi - done + rtpdir='/var/lib/rtpengine-recording' + if ! dpkg-statoverride --list "$rtpdir" > /dev/null 2>&1; then + chown rtpengine:rtpengine "$rtpdir" + chmod 0770 "$rtpdir" + fi fi #DEBHELPER#